mirror of
https://github.com/datahub-project/datahub.git
synced 2025-06-27 05:03:31 +00:00
Added hashing
This commit is contained in:
parent
01bb925379
commit
e7e29a9071
@ -116,6 +116,9 @@ class ColumnRef(_FrozenModel):
|
||||
table: Urn
|
||||
column: str
|
||||
|
||||
def __hash__(self):
|
||||
return hash((self.table, self.column))
|
||||
|
||||
|
||||
class _DownstreamColumnRef(_ParserBaseModel):
|
||||
table: Optional[_TableName] = None
|
||||
@ -139,11 +142,17 @@ class DownstreamColumnRef(_ParserBaseModel):
|
||||
return v
|
||||
return SchemaFieldDataTypeClass.from_obj(v)
|
||||
|
||||
def __hash__(self):
|
||||
return hash((self.table, self.column, self.native_column_type))
|
||||
|
||||
|
||||
class ColumnTransformation(_ParserBaseModel):
|
||||
is_direct_copy: bool
|
||||
column_logic: str
|
||||
|
||||
def __hash__(self):
|
||||
return hash((self.is_direct_copy, self.column_logic))
|
||||
|
||||
|
||||
class _ColumnLineageInfo(_ParserBaseModel):
|
||||
downstream: _DownstreamColumnRef
|
||||
@ -158,6 +167,9 @@ class ColumnLineageInfo(_ParserBaseModel):
|
||||
|
||||
logic: Optional[ColumnTransformation] = pydantic.Field(default=None)
|
||||
|
||||
def __hash__(self):
|
||||
return hash((self.downstream, tuple(self.upstreams), self.logic))
|
||||
|
||||
|
||||
class _JoinInfo(_ParserBaseModel):
|
||||
join_type: str
|
||||
|
Loading…
x
Reference in New Issue
Block a user