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

Commit afa2326

Browse files
committed
Fix databricks
1 parent 2196b12 commit afa2326

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

data_diff/sqeleton/databases/databricks.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ def __init__(self, *, thread_count, **kw):
8686
logging.getLogger("databricks.sql").setLevel(logging.WARNING)
8787

8888
self._args = kw
89-
self.default_schema = kw.get("schema", "hive_metastore")
89+
self.default_schema = kw.get("schema", "default")
90+
self.catalog = self._args.get("catalog", "hive_metastore")
9091
super().__init__(thread_count=thread_count)
9192

9293
def create_connection(self):
@@ -97,7 +98,7 @@ def create_connection(self):
9798
server_hostname=self._args["server_hostname"],
9899
http_path=self._args["http_path"],
99100
access_token=self._args["access_token"],
100-
catalog=self._args["catalog"],
101+
catalog=self.catalog,
101102
)
102103
except databricks.sql.exc.Error as e:
103104
raise ConnectionError(*e.args) from e
@@ -111,7 +112,7 @@ def query_table_schema(self, path: DbPath) -> Dict[str, tuple]:
111112

112113
schema, table = self._normalize_table_path(path)
113114
with conn.cursor() as cursor:
114-
cursor.columns(catalog_name=self._args["catalog"], schema_name=schema, table_name=table)
115+
cursor.columns(catalog_name=self.catalog, schema_name=schema, table_name=table)
115116
try:
116117
rows = cursor.fetchall()
117118
finally:

0 commit comments

Comments
 (0)