Skip to content

Commit

Permalink
remove whitespace fixes to reduce PR confusion
Browse files Browse the repository at this point in the history
  • Loading branch information
mikealfare committed Dec 20, 2023
1 parent 534cd0f commit 0efc5a4
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions dbt/adapters/spark/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,10 +415,18 @@ def _get_one_catalog(
raise dbt.exceptions.CompilationError(
f"Expected only one schema in spark _get_one_catalog, found " f"{schemas}"
)

relations = self.list_relations(information_schema.database, schemas.pop())
database = information_schema.database
schema = list(schemas)[0]
relations = self.list_relations(database, schema)
return self._get_relation_metadata_at_column_level(relations)

def _get_relation_metadata_at_column_level(self, relations: List[BaseRelation]) -> agate.Table:
columns: List[Dict[str, Any]] = []
for relation in relations:
logger.debug("Getting table schema for relation {}", str(relation))
columns.extend(self._get_columns_for_catalog(relation))
return agate.Table.from_object(columns, column_types=DEFAULT_TYPE_TESTER)

def _get_one_catalog_by_relations(
self,
information_schema: InformationSchema,
Expand All @@ -430,13 +438,6 @@ def _get_one_catalog_by_relations(
]
return self._get_relation_metadata_at_column_level(cached_relations)

def _get_relation_metadata_at_column_level(self, relations: List[BaseRelation]) -> agate.Table:
columns: List[Dict[str, Any]] = []
for relation in relations:
logger.debug("Getting table schema for relation {}", str(relation))
columns.extend(self._get_columns_for_catalog(relation))
return agate.Table.from_object(columns, column_types=DEFAULT_TYPE_TESTER)

def check_schema_exists(self, database: str, schema: str) -> bool:
results = self.execute_macro(LIST_SCHEMAS_MACRO_NAME, kwargs={"database": database})

Expand Down

0 comments on commit 0efc5a4

Please sign in to comment.