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

MINOR: Snowflake UDF Lineage Support - main #18886

Merged
merged 4 commits into from
Dec 4, 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
2 changes: 1 addition & 1 deletion ingestion/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
"requests>=2.23",
"requests-aws4auth~=1.1", # Only depends on requests as external package. Leaving as base.
"sqlalchemy>=1.4.0,<2",
"collate-sqllineage~=1.4.0",
"collate-sqllineage~=1.5.0",
"tabulate==0.9.0",
"typing-inspect",
"packaging", # For version parsing
Expand Down
10 changes: 6 additions & 4 deletions ingestion/src/metadata/ingestion/lineage/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
from collections import defaultdict
from copy import deepcopy
from logging.config import DictConfigurator
from typing import Any, Dict, List, Optional, Tuple
from typing import Any, Dict, List, Optional, Tuple, Union

import sqlparse
from cached_property import cached_property
from collate_sqllineage import SQLPARSE_DIALECT
from collate_sqllineage.core.models import Column, Table
from collate_sqllineage.core.models import Column, DataFunction, Table
from collate_sqllineage.exceptions import SQLLineageException
from collate_sqllineage.runner import LineageRunner
from sqlparse.sql import Comparison, Identifier, Parenthesis, Statement
Expand Down Expand Up @@ -110,7 +110,7 @@ def intermediate_tables(self) -> List[Table]:
return []

@cached_property
def source_tables(self) -> List[Table]:
def source_tables(self) -> List[Union[Table, DataFunction]]:
"""
Get a list of source tables
"""
Expand Down Expand Up @@ -374,7 +374,9 @@ def retrieve_tables(self, tables: List[Any]) -> List[Table]:
if not self._clean_query:
return []
return [
self.clean_table_name(table) for table in tables if isinstance(table, Table)
self.clean_table_name(table)
for table in tables
if isinstance(table, (Table, DataFunction))
]

@classmethod
Expand Down
Loading
Loading