diff --git a/dbt/adapters/athena/impl.py b/dbt/adapters/athena/impl.py index 2ce693ed..20e248ee 100755 --- a/dbt/adapters/athena/impl.py +++ b/dbt/adapters/athena/impl.py @@ -548,8 +548,7 @@ def _s3_path_exists(self, s3_bucket: str, s3_prefix: str) -> bool: response = s3_client.list_objects_v2(Bucket=s3_bucket, Prefix=s3_prefix) return True if "Contents" in response else False - @staticmethod - def _get_one_table_for_catalog(table: TableTypeDef, database: str) -> List[Dict[str, Any]]: + def _get_one_table_for_catalog(self, table: TableTypeDef, database: str) -> List[Dict[str, Any]]: table_catalog = { "table_database": database, "table_schema": table["DatabaseName"], @@ -568,6 +567,7 @@ def _get_one_table_for_catalog(table: TableTypeDef, database: str) -> List[Dict[ }, } for idx, col in enumerate(table["StorageDescriptor"]["Columns"] + table.get("PartitionKeys", [])) + if self._is_current_column(col) ] @staticmethod @@ -1098,9 +1098,7 @@ def _is_current_column(col: ColumnTypeDef) -> bool: """ Check if a column is explicitly set as not current. If not, it is considered as current. """ - if col.get("Parameters", {}).get("iceberg.field.current") == "false": - return False - return True + return col.get("Parameters", {}).get("iceberg.field.current") != "false" @available def get_columns_in_relation(self, relation: AthenaRelation) -> List[AthenaColumn]: diff --git a/tests/functional/adapter/test_docs.py b/tests/functional/adapter/test_docs.py index 663d3027..5cb87ae1 100644 --- a/tests/functional/adapter/test_docs.py +++ b/tests/functional/adapter/test_docs.py @@ -51,7 +51,7 @@ class TestDocsGenerate(BaseDocsGenerate): """ @pytest.fixture(scope="class") - def expected_catalog(self, project): + def expected_catalog(self, project, profile_user): return base_expected_catalog( project, role="test",