File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
great_expectations/expectations Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -184,6 +184,20 @@ class NullityCondition(Condition):
184184 column : Column
185185 is_null : bool
186186
187+ @validator ("column" , pre = True )
188+ @classmethod
189+ def _ensure_column_object (cls , v : Column | str | dict ) -> Column :
190+ """Convert column field to Column object if it's a string or dict.
191+
192+ This handles deserialization from GX Cloud where the column might be
193+ provided as a plain string or dict instead of a Column object.
194+ """
195+ if isinstance (v , str ):
196+ return Column (name = v )
197+ elif isinstance (v , dict ):
198+ return Column (** v )
199+ return v # Already a Column object
200+
187201 @override
188202 def __repr__ (self ):
189203 null_str = "NULL" if self .is_null else "NOT NULL"
@@ -196,6 +210,20 @@ class ComparisonCondition(Condition):
196210 operator : Operator
197211 parameter : Parameter = Field (...)
198212
213+ @validator ("column" , pre = True )
214+ @classmethod
215+ def _ensure_column_object (cls , v : Column | str | dict ) -> Column :
216+ """Convert column field to Column object if it's a string or dict.
217+
218+ This handles deserialization from GX Cloud where the column might be
219+ provided as a plain string or dict instead of a Column object.
220+ """
221+ if isinstance (v , str ):
222+ return Column (name = v )
223+ elif isinstance (v , dict ):
224+ return Column (** v )
225+ return v # Already a Column object
226+
199227 @root_validator
200228 def _validate_parameter_not_none (cls , values ):
201229 parameter = values .get ("parameter" )
You can’t perform that action at this time.
0 commit comments