Skip to content

Commit 5e9188c

Browse files
authored
fix(ingest/databricks): Updating code to work with Databricks sdk 0.30 (#11158)
1 parent 9dc85cb commit 5e9188c

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

docs-website/sidebars.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,7 @@ module.exports = {
924924
// "docs/_api-guide-template"
925925
// - "metadata-service/services/README"
926926
// "metadata-ingestion/examples/structured_properties/README"
927+
// "smoke-test/tests/openapi/README"
927928
// ],
928929
],
929930
};

metadata-ingestion/setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@
104104

105105
classification_lib = {
106106
"acryl-datahub-classify==0.0.11",
107+
# schwifty is needed for the classify plugin but in 2024.08.0 they broke the python 3.8 compatibility
108+
"schwifty<2024.08.0",
107109
# This is a bit of a hack. Because we download the SpaCy model at runtime in the classify plugin,
108110
# we need pip to be available.
109111
"pip",

metadata-ingestion/src/datahub/ingestion/source/unity/proxy_profiling.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
import logging
22
import time
3-
from typing import Optional, Union
3+
from typing import Optional
44

55
from databricks.sdk import WorkspaceClient
66
from databricks.sdk.core import DatabricksError
77
from databricks.sdk.service._internal import Wait
88
from databricks.sdk.service.catalog import TableInfo
99
from databricks.sdk.service.sql import (
10-
ExecuteStatementResponse,
11-
GetStatementResponse,
1210
GetWarehouseResponse,
11+
StatementResponse,
1312
StatementState,
1413
StatementStatus,
1514
)
@@ -125,7 +124,7 @@ def _should_retry_unsupported_column(
125124

126125
def _analyze_table(
127126
self, ref: TableReference, include_columns: bool
128-
) -> ExecuteStatementResponse:
127+
) -> StatementResponse:
129128
statement = f"ANALYZE TABLE {ref.schema}.{ref.table} COMPUTE STATISTICS"
130129
if include_columns:
131130
statement += " FOR ALL COLUMNS"
@@ -139,7 +138,7 @@ def _analyze_table(
139138
return response
140139

141140
def _check_analyze_table_statement_status(
142-
self, execute_response: ExecuteStatementResponse, max_wait_secs: int
141+
self, execute_response: StatementResponse, max_wait_secs: int
143142
) -> bool:
144143
if not execute_response.statement_id or not execute_response.status:
145144
return False
@@ -230,9 +229,7 @@ def _get_int(self, table_info: TableInfo, field: str) -> Optional[int]:
230229
return None
231230

232231
@staticmethod
233-
def _raise_if_error(
234-
response: Union[ExecuteStatementResponse, GetStatementResponse], key: str
235-
) -> None:
232+
def _raise_if_error(response: StatementResponse, key: str) -> None:
236233
if response.status and response.status.state in [
237234
StatementState.FAILED,
238235
StatementState.CANCELED,

0 commit comments

Comments
 (0)