mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-12 10:35:51 +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(
|
||||
type=(
|
||||
FieldValuesFailThresholdTypeClass.COUNT
|
||||
if self.type == Literal["count"]
|
||||
if self.type == "count"
|
||||
else FieldValuesFailThresholdTypeClass.PERCENTAGE
|
||||
),
|
||||
value=self.value,
|
||||
@ -81,7 +81,7 @@ class FieldValuesAssertion(BaseEntityAssertion):
|
||||
excludeNulls=self.exclude_nulls,
|
||||
transform=(
|
||||
FieldTransformClass(type=FieldTransformTypeClass.LENGTH)
|
||||
if self.field_transform == Literal["length"]
|
||||
if self.field_transform == FieldTransform.LENGTH
|
||||
else None
|
||||
),
|
||||
),
|
||||
|
||||
@ -58,7 +58,7 @@ class SqlMetricChangeAssertion(BaseEntityAssertion):
|
||||
statement=self.statement,
|
||||
changeType=(
|
||||
AssertionValueChangeType.ABSOLUTE
|
||||
if self.change_type == Literal["absolute"]
|
||||
if self.change_type == "absolute"
|
||||
else AssertionValueChangeType.PERCENTAGE
|
||||
),
|
||||
operator=self.operator.operator,
|
||||
|
||||
@ -64,7 +64,7 @@ class RowCountChangeVolumeAssertion(BaseEntityAssertion):
|
||||
rowCountChange=RowCountChange(
|
||||
type=(
|
||||
AssertionValueChangeType.ABSOLUTE
|
||||
if self.change_type == Literal["absolute"]
|
||||
if self.change_type == "absolute"
|
||||
else AssertionValueChangeType.PERCENTAGE
|
||||
),
|
||||
operator=self.operator.operator,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user