File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -392,13 +392,24 @@ def validate_schema(
392
392
v : t .Union [
393
393
t .Dict [str , exp .DataType ],
394
394
t .List [t .Tuple [str , exp .DataType ]],
395
+ t .Dict [str , t .Tuple [exp .DataType , exp .DataType ]],
395
396
t .Dict [str , str ],
396
397
],
398
+ info : ValidationInfo ,
397
399
) -> t .Dict [str , str ]:
398
400
if isinstance (v , dict ):
399
- return {k : str (v ) for k , v in v .items ()}
401
+ # Handle modified field which has tuples of (source_type, target_type)
402
+ if info .field_name == "modified" and any (isinstance (val , tuple ) for val in v .values ()):
403
+ return {
404
+ k : f"{ str (val [0 ])} → { str (val [1 ])} "
405
+ for k , val in v .items ()
406
+ if isinstance (val , tuple )
407
+ and isinstance (val [0 ], exp .DataType )
408
+ and isinstance (val [1 ], exp .DataType )
409
+ }
410
+ return {k : str (val ) for k , val in v .items ()}
400
411
if isinstance (v , list ):
401
- return {k : str (v ) for k , v in v }
412
+ return {k : str (val ) for k , val in v }
402
413
return v
403
414
404
415
You can’t perform that action at this time.
0 commit comments