Skip to content

Commit c36d337

Browse files
SofiaSazonovaSofia Sazonova
andauthored
Integration tests glossaries/dashboard bugfix (#1765)
### Feature or Bugfix <!-- please choose --> - Bugfix ### Detail - MetadataForm Entity methods => uri(), catalog method => uri_column() - frontend visibility bugfix ### Relates - <URL or Ticket> ### Security Please answer the questions below briefly where applicable, or write `N/A`. Based on [OWASP 10](https://owasp.org/Top10/en/). - Does this PR introduce or modify any input fields or queries - this includes fetching data from storage outside the application (e.g. a database, an S3 bucket)? - Is the input sanitized? - What precautions are you taking before deserializing the data you consume? - Is injection prevented by parametrizing queries? - Have you ensured no `eval` or similar functions are used? - Does this PR introduce any functionality or component that requires authorization? - How have you ensured it respects the existing AuthN/AuthZ mechanisms? - Are you logging failed auth attempts? - Are you using or adding any cryptographic features? - Do you use a standard proven implementations? - Are the used keys controlled by the customer? Where are they stored? - Are you introducing any new policies/roles/users? - Have you used the least-privilege principle? How? By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Co-authored-by: Sofia Sazonova <sazonova@amazon.co.uk>
1 parent 8b3b94b commit c36d337

9 files changed

Lines changed: 27 additions & 8 deletions

File tree

backend/dataall/modules/catalog/indexers/registry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class Identifiable(Protocol):
1111
@classmethod
12-
def uri(cls): ...
12+
def uri_column(cls): ...
1313

1414

1515
@dataclass
@@ -22,7 +22,7 @@ class GlossaryDefinition:
2222
reindexer: Type[BaseIndexer] = None # a callback to reindex glossaries in open search
2323

2424
def target_uri(self):
25-
return self.model.uri()
25+
return self.model.uri_column()
2626

2727

2828
class GlossaryRegistry(UnionTypeRegistry):

backend/dataall/modules/dashboards/db/dashboard_models.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ class Dashboard(Resource, Base):
3636

3737
userRoleForDashboard = query_expression()
3838

39+
@classmethod
40+
def uri_column(cls):
41+
return cls.dashboardUri
42+
3943
def uri(self):
4044
return self.dashboardUri
4145

backend/dataall/modules/datasets_base/db/dataset_models.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ class DatasetBase(Resource, Base):
3636
expiryMaxDuration = Column(Integer, nullable=True)
3737
__mapper_args__ = {'polymorphic_identity': 'dataset', 'polymorphic_on': datasetType}
3838

39+
@classmethod
40+
def uri_column(cls):
41+
return cls.datasetUri
42+
3943
def owner_name(self):
4044
return self.SamlAdminGroupName
4145

backend/dataall/modules/redshift_datasets/db/redshift_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ class RedshiftTable(Base, Resource):
3939
topics = Column(ARRAY(String), nullable=True)
4040

4141
@classmethod
42-
def uri(cls):
42+
def uri_column(cls):
4343
return cls.rsTableUri

backend/dataall/modules/s3_datasets/db/dataset_models.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class DatasetTableColumn(Resource, Base):
2121
columnType = Column(String, default='column') # can be either "column" or "partition"
2222

2323
@classmethod
24-
def uri(cls):
24+
def uri_column(cls):
2525
return cls.columnUri
2626

2727

@@ -63,6 +63,10 @@ def entity_name(self):
6363
def uri(self):
6464
return self.locationUri
6565

66+
@classmethod
67+
def uri_column(cls):
68+
return cls.locationUri
69+
6670

6771
class DatasetTable(Resource, Base):
6872
__metaclass__ = MetadataFormEntity
@@ -95,6 +99,10 @@ def entity_name(self):
9599
def uri(self):
96100
return self.tableUri
97101

102+
@classmethod
103+
def uri_column(cls):
104+
return cls.tableUri
105+
98106

99107
class S3Dataset(DatasetBase):
100108
__tablename__ = 's3_dataset'
@@ -156,6 +164,10 @@ def entity_name(self):
156164
def uri(self):
157165
return self.bucketUri
158166

167+
@classmethod
168+
def uri_column(cls):
169+
return cls.bucketUri
170+
159171

160172
class DatasetTableDataFilter(Resource, Base):
161173
__tablename__ = 'data_filter'

backend/migrations/versions/797dd1012be1_resource_lock_table.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class DatasetLock(Base):
6262
acquiredBy = Column(String, nullable=True)
6363

6464
@classmethod
65-
def uri(cls):
65+
def uri_column(cls):
6666
return cls.datasetUri
6767

6868

backend/migrations/versions/8c79fb896983_add_table_for_buckets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class DatasetBucket(Resource, Base):
101101
environmentEndPoint = query_expression()
102102

103103
@classmethod
104-
def uri(cls):
104+
def uri_column(cls):
105105
return cls.bucketUri
106106

107107

backend/migrations/versions/a1049d854e29_implement_dataset_locking_mechanism.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class DatasetLock(Base):
8888
acquiredBy = Column(String, nullable=True)
8989

9090
@classmethod
91-
def uri(cls):
91+
def uri_column(cls):
9292
return cls.datasetUri
9393

9494

frontend/src/modules/Metadata_Forms/components/metadataAttachment.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ export const MetadataAttachment = (props) => {
237237
<Autocomplete
238238
disablePortal
239239
options={availableForms}
240-
value={selectedForm.name}
241240
onChange={async (event, value) => {
242241
if (value) {
243242
setSelectedForm(value.form);

0 commit comments

Comments
 (0)