fix: logic for number of profiled tables (#11222)

* fix: logic for number of profiled tables

* fix: python linting
This commit is contained in:
Teddy 2023-04-24 08:00:25 +02:00 committed by GitHub
parent d3d523e96d
commit 017fbc6a32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 2 deletions

View File

@ -62,9 +62,11 @@ class CliCommonDB:
self, source_status: SourceStatus, sink_status: SinkStatus
):
self.assertTrue(len(source_status.failures) == 0)
self.assertTrue(len(source_status.records) >= self.expected_tables())
self.assertTrue(
len(source_status.records) >= self.expected_profiled_tables()
)
self.assertTrue(len(sink_status.failures) == 0)
self.assertTrue(len(sink_status.records) >= self.expected_tables())
self.assertTrue(len(sink_status.records) >= self.expected_profiled_tables())
sample_data = self.retrieve_sample_data(self.fqn_created_table()).sampleData
lineage = self.retrieve_lineage(self.fqn_created_table())
self.assertTrue(len(sample_data.rows) == self.inserted_rows_count())
@ -195,11 +197,20 @@ class CliCommonDB:
def _fqn_deleted_table() -> Optional[str]:
return None
@staticmethod
def _expected_profiled_tables() -> int:
return None
def fqn_deleted_table(self) -> str:
if self._fqn_deleted_table() is None:
return self.fqn_created_table()
return self._fqn_deleted_table() # type: ignore
def expected_profiled_tables(self) -> int:
if self._expected_profiled_tables() is None:
return self.expected_tables()
return self._expected_profiled_tables()
@staticmethod
@abstractmethod
def expected_filtered_schema_includes() -> int:

View File

@ -65,6 +65,10 @@ class BigqueryCliTest(CliCommonDB.TestSuite, SQACommonMethods):
def view_column_lineage_count(self) -> int:
return 2
@staticmethod
def _expected_profiled_tables() -> int:
return 2
@staticmethod
def fqn_created_table() -> str:
return "local_bigquery.open-metadata-beta.exclude_me.orders"

View File

@ -63,6 +63,10 @@ class VerticaCliTest(CliCommonDB.TestSuite, SQACommonMethods):
def expected_tables() -> int:
return 16
@staticmethod
def _expected_profiled_tables() -> int:
return 12
def inserted_rows_count(self) -> int:
return len(self.insert_data_queries)