Skip to content

Commit

Permalink
fix(ingest): workaround great-expectations compatibility issue
Browse files Browse the repository at this point in the history
  • Loading branch information
hsheth2 committed Nov 29, 2021
1 parent de03827 commit 0b6ba65
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
12 changes: 7 additions & 5 deletions metadata-ingestion/setup.py
Expand Up @@ -23,7 +23,7 @@ def get_long_description():
base_requirements = {
# Compatability.
"dataclasses>=0.6; python_version < '3.7'",
"typing_extensions>=3.7.4; python_version < '3.8'",
"typing_extensions>=3.10.0.2",
"mypy_extensions>=0.4.3",
# Actual dependencies.
"typing-inspect",
Expand Down Expand Up @@ -60,7 +60,7 @@ def get_long_description():
# Required for all SQL sources.
"sqlalchemy==1.3.24",
# Required for SQL profiling.
"great-expectations==0.13.43",
"great-expectations>=0.13.40",
"greenlet",
}

Expand Down Expand Up @@ -144,7 +144,6 @@ def get_long_description():
# PR is from same author as that of sqlalchemy-trino library below.
"sqlalchemy-trino"
},

}

all_exclude_plugins: Set[str] = {
Expand Down Expand Up @@ -219,7 +218,11 @@ def get_long_description():
# The trino plugin only works on Python 3.7 or newer.
# The trino plugin can be supported on Python 3.6 with minimal changes to opensource sqlalchemy-trino sourcecode.
base_dev_requirements = base_dev_requirements.union(
{dependency for plugin in ["lookml", "trino", "starburst-trino-usage"] for dependency in plugins[plugin]}
{
dependency
for plugin in ["lookml", "trino", "starburst-trino-usage"]
for dependency in plugins[plugin]
}
)

dev_requirements = {
Expand Down Expand Up @@ -292,7 +295,6 @@ def get_long_description():
"openapi = datahub.ingestion.source.openapi:OpenApiSource",
"trino = datahub.ingestion.source.sql.trino:TrinoSource",
"starburst-trino-usage = datahub.ingestion.source.usage.starburst_trino_usage:TrinoUsageSource",

],
"datahub.ingestion.sink.plugins": [
"file = datahub.ingestion.sink.file:FileSink",
Expand Down
Expand Up @@ -10,6 +10,17 @@
import uuid
from typing import Any, Callable, Dict, Iterable, Iterator, List, Optional, Tuple, Union

# Fun compatibility hack! GE version 0.13.44 broke compatibility with SQLAlchemy 1.3.24.
# This is a temporary workaround until GE fixes the issue on their end.
# See https://github.com/great-expectations/great_expectations/issues/3758.
try:
import sqlalchemy.engine
from sqlalchemy.engine.url import make_url

sqlalchemy.engine.make_url = make_url # type: ignore
except ImportError:
pass

import pydantic
from great_expectations.data_context import BaseDataContext
from great_expectations.data_context.types.base import (
Expand Down

0 comments on commit 0b6ba65

Please sign in to comment.