Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit 18f65ee

Browse files
committed
Fixes for databricks
1 parent 747fd22 commit 18f65ee

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

data_diff/databases/database_types.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,10 @@ def select_table_schema(self, path: DbPath) -> str:
170170
"Provide SQL for selecting the table schema as (name, type, date_prec, num_prec)"
171171
...
172172

173-
174173
@abstractmethod
175174
def query_table_schema(self, path: DbPath) -> Dict[str, tuple]:
176175
"""Query the table for its schema for table in 'path', and return {column: tuple}
177-
where the tuple is (table_name, col_name, type_repr, datetime_precision?, numeric_precision?, numeric_scale?)
176+
where the tuple is (table_name, col_name, type_repr, datetime_precision?, numeric_precision?, numeric_scale?)
178177
"""
179178
...
180179

data_diff/databases/databricks.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,10 @@ def query_table_schema(self, path: DbPath) -> Dict[str, tuple]:
8080
if not rows:
8181
raise RuntimeError(f"{self.name}: Table '{'.'.join(path)}' does not exist, or has no columns")
8282

83-
d = {r[0]: r for r in rows}
83+
d = {r.COLUMN_NAME: r for r in rows}
8484
assert len(d) == len(rows)
8585
return d
8686

87-
8887
def _process_table_schema(self, path: DbPath, raw_schema: Dict[str, tuple], filter_columns: Sequence[str]):
8988
accept = {i.lower() for i in filter_columns}
9089
rows = [row for name, row in raw_schema.items() if name.lower() in accept]

0 commit comments

Comments
 (0)