Skip to content

Commit

Permalink
refactor(ingest): snowflake - update field name for column lineage (d…
Browse files Browse the repository at this point in the history
  • Loading branch information
mayurinehate authored and cccs-tom committed Nov 18, 2022
1 parent 81bf49d commit a9262b9
Show file tree
Hide file tree
Showing 3 changed files with 196 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from dataclasses import dataclass, field
from typing import Dict, FrozenSet, List, Optional, Set, Tuple

from pydantic import Field
from pydantic.error_wrappers import ValidationError
from snowflake.connector import SnowflakeConnection

Expand Down Expand Up @@ -32,7 +33,13 @@


class SnowflakeColumnWithLineage(SnowflakeColumnReference):
directSourceColumns: Optional[List[SnowflakeColumnReference]] = None
class Config:
# This is for backward compatibility and can be removed later
allow_population_by_field_name = True

directSourceColumns: Optional[List[SnowflakeColumnReference]] = Field(
default=None, alias="directSources"
)


@dataclass(frozen=True)
Expand Down Expand Up @@ -125,6 +132,7 @@ def update_lineage(self, table: SnowflakeUpstreamTable) -> None:

if table.downstreamColumns:
for col in table.downstreamColumns:

if col.directSourceColumns:
self.columnLineages[col.columnName].update_column_lineage(
col.directSourceColumns
Expand Down
Loading

0 comments on commit a9262b9

Please sign in to comment.