Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ingestion/looker): Add sqlglot dependency and remove unused sqlparser #10874

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions metadata-ingestion/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@
# LookML files with spaces between an item and the following comma.
# See https://github.com/joshtemple/lkml/issues/73.
"lkml>=1.3.4",
"sql-metadata==2.2.2",
*sqllineage_lib,
*sqlglot_lib,
"GitPython>2",
"python-liquid",
}
Expand Down Expand Up @@ -372,7 +371,7 @@
"kafka-connect": sql_common | {"requests", "JPype1"},
"ldap": {"python-ldap>=2.4"},
"looker": looker_common,
"lookml": looker_common | sqlglot_lib,
"lookml": looker_common,
"metabase": {"requests"} | sqlglot_lib,
"mlflow": {
"mlflow-skinny>=2.3.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from collections import OrderedDict
from dataclasses import dataclass
from datetime import datetime, timezone
from typing import Dict, Iterable, List, Optional, Set, Tuple, Type
from typing import Dict, Iterable, List, Optional, Set, Tuple

import lkml
import lkml.simple
Expand All @@ -22,7 +22,6 @@
platform_name,
support_status,
)
from datahub.ingestion.api.registry import import_path
from datahub.ingestion.api.source import MetadataWorkUnitProcessor, SourceCapability
from datahub.ingestion.api.workunit import MetadataWorkUnit
from datahub.ingestion.source.common.subtypes import (
Expand Down Expand Up @@ -96,7 +95,6 @@
SubTypesClass,
)
from datahub.sql_parsing.sqlglot_lineage import ColumnRef
from datahub.utilities.sql_parser import SQLParser

logger = logging.getLogger(__name__)

Expand All @@ -111,15 +109,6 @@ class LookerView:
raw_file_content: str
view_details: Optional[ViewProperties] = None

@classmethod
def _import_sql_parser_cls(cls, sql_parser_path: str) -> Type[SQLParser]:
assert "." in sql_parser_path, "sql_parser-path must contain a ."
parser_cls = import_path(sql_parser_path)

if not issubclass(parser_cls, SQLParser):
raise ValueError(f"must be derived from {SQLParser}; got {parser_cls}")
return parser_cls

@classmethod
def determine_view_file_path(
cls, base_folder_path: str, absolute_file_path: str
Expand Down
Loading