mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-14 03:26:47 +00:00
fix(python): correct Literal type comparison bugs in assertion classes (#15269)
This commit is contained in:
parent
c21af0e29a
commit
0553f28e2a
@ -38,7 +38,7 @@ class FieldValuesFailThreshold(v1_ConfigModel):
|
|||||||
return FieldValuesFailThresholdClass(
|
return FieldValuesFailThresholdClass(
|
||||||
type=(
|
type=(
|
||||||
FieldValuesFailThresholdTypeClass.COUNT
|
FieldValuesFailThresholdTypeClass.COUNT
|
||||||
if self.type == Literal["count"]
|
if self.type == "count"
|
||||||
else FieldValuesFailThresholdTypeClass.PERCENTAGE
|
else FieldValuesFailThresholdTypeClass.PERCENTAGE
|
||||||
),
|
),
|
||||||
value=self.value,
|
value=self.value,
|
||||||
@ -81,7 +81,7 @@ class FieldValuesAssertion(BaseEntityAssertion):
|
|||||||
excludeNulls=self.exclude_nulls,
|
excludeNulls=self.exclude_nulls,
|
||||||
transform=(
|
transform=(
|
||||||
FieldTransformClass(type=FieldTransformTypeClass.LENGTH)
|
FieldTransformClass(type=FieldTransformTypeClass.LENGTH)
|
||||||
if self.field_transform == Literal["length"]
|
if self.field_transform == FieldTransform.LENGTH
|
||||||
else None
|
else None
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -58,7 +58,7 @@ class SqlMetricChangeAssertion(BaseEntityAssertion):
|
|||||||
statement=self.statement,
|
statement=self.statement,
|
||||||
changeType=(
|
changeType=(
|
||||||
AssertionValueChangeType.ABSOLUTE
|
AssertionValueChangeType.ABSOLUTE
|
||||||
if self.change_type == Literal["absolute"]
|
if self.change_type == "absolute"
|
||||||
else AssertionValueChangeType.PERCENTAGE
|
else AssertionValueChangeType.PERCENTAGE
|
||||||
),
|
),
|
||||||
operator=self.operator.operator,
|
operator=self.operator.operator,
|
||||||
|
|||||||
@ -64,7 +64,7 @@ class RowCountChangeVolumeAssertion(BaseEntityAssertion):
|
|||||||
rowCountChange=RowCountChange(
|
rowCountChange=RowCountChange(
|
||||||
type=(
|
type=(
|
||||||
AssertionValueChangeType.ABSOLUTE
|
AssertionValueChangeType.ABSOLUTE
|
||||||
if self.change_type == Literal["absolute"]
|
if self.change_type == "absolute"
|
||||||
else AssertionValueChangeType.PERCENTAGE
|
else AssertionValueChangeType.PERCENTAGE
|
||||||
),
|
),
|
||||||
operator=self.operator.operator,
|
operator=self.operator.operator,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user