File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -236,6 +236,12 @@ def upsert_workbench_meta(self, new_meta: dict):
236236 This functionality will work for FeatureSets, Models, and Endpoints
237237 but not for DataSources. The DataSource class overrides this method.
238238 """
239+
240+ # Check for ReadOnly Role
241+ if self .aws_account_clamp .read_only_role :
242+ self .log .info ("Cannot add metadata with a ReadOnly Role..." )
243+ return
244+
239245 # Sanity check
240246 aws_arn = self .arn ()
241247 if aws_arn is None :
@@ -444,10 +450,12 @@ def delete_metadata(self, key_to_delete: str):
444450
445451if __name__ == "__main__" :
446452 """Exercise the Artifact Class"""
447- from workbench .api .data_source import DataSource
448- from workbench .api .feature_set import FeatureSet
453+ from workbench .api import DataSource , FeatureSet , Endpoint
454+
455+ # Grab an Endpoint (which is a subclass of Artifact)
456+ end = Endpoint ("wine-classification" )
449457
450- # Create a DataSource (which is a subclass of Artifact)
458+ # Grab a DataSource (which is a subclass of Artifact)
451459 data_source = DataSource ("test_data" )
452460
453461 # Just some random tests
Original file line number Diff line number Diff line change @@ -54,7 +54,10 @@ def __init__(self):
5454
5555 # Check our Assume Role
5656 self .log .info ("Checking Workbench Assumed Role..." )
57- self .aws_session .assumed_role_info ()
57+ role_info = self .aws_session .assumed_role_info ()
58+
59+ # Check if the Role is a 'ReadOnly' role
60+ self .read_only_role = "readonly" in role_info ["AssumedRoleArn" ].lower ()
5861
5962 # Check our Workbench API Key and Load the License
6063 self .log .info ("Checking Workbench API License..." )
You can’t perform that action at this time.
0 commit comments