-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into kml/sourcesError
- Loading branch information
Showing
6 changed files
with
259 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,42 @@ | ||
from __future__ import annotations | ||
|
||
from great_expectations.compatibility.not_imported import NotImported | ||
|
||
DATABRICKS_CONNECT_NOT_IMPORTED = NotImported( | ||
"databricks-connect is not installed, please 'pip install databricks-connect'" | ||
) | ||
|
||
# The following types are modeled after the following documentation that is part | ||
# of the databricks package. | ||
# tldr: SQLAlchemy application should (mostly) "just work" with Databricks, | ||
# other than the exceptions below | ||
# https://github.com/databricks/databricks-sql-python/blob/main/src/databricks/sqlalchemy/README.sqlalchemy.md | ||
|
||
try: | ||
from databricks.sqlalchemy._types import TIMESTAMP_NTZ as TIMESTAMP_NTZ # noqa: PLC0414, RUF100 | ||
except (ImportError, AttributeError): | ||
TIMESTAMP_NTZ = DATABRICKS_CONNECT_NOT_IMPORTED # type: ignore[misc, assignment] | ||
|
||
try: | ||
from databricks.sqlalchemy._types import DatabricksStringType as STRING # noqa: PLC0414, RUF100 | ||
except (ImportError, AttributeError): | ||
STRING = DATABRICKS_CONNECT_NOT_IMPORTED # type: ignore[misc, assignment] | ||
|
||
try: | ||
from databricks import connect | ||
except ImportError: | ||
connect = DATABRICKS_CONNECT_NOT_IMPORTED | ||
from databricks.sqlalchemy._types import TIMESTAMP as TIMESTAMP # noqa: PLC0414, RUF100 | ||
except (ImportError, AttributeError): | ||
TIMESTAMP = DATABRICKS_CONNECT_NOT_IMPORTED # type: ignore[misc, assignment] | ||
|
||
try: | ||
from databricks.sqlalchemy._types import TINYINT as TINYINT # noqa: PLC0414, RUF100 | ||
except (ImportError, AttributeError): | ||
TINYINT = DATABRICKS_CONNECT_NOT_IMPORTED # type: ignore[misc, assignment] | ||
|
||
|
||
class DATABRICKS_TYPES: | ||
"""Namespace for Databricks dialect types""" | ||
|
||
TIMESTAMP_NTZ = TIMESTAMP_NTZ | ||
STRING = STRING | ||
TINYINT = TINYINT | ||
TIMESTAMP = TIMESTAMP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters