@@ -650,12 +650,12 @@ def needConversion(self) -> bool: # noqa: D102
650650 def toInternal (self , obj : dict [T , Optional [U ]]) -> dict [T , Optional [U ]]: # noqa: D102
651651 if not self .needConversion ():
652652 return obj
653- return obj and dict (( self .keyType .toInternal (k ), self .valueType .toInternal (v )) for k , v in obj .items ())
653+ return obj and { self .keyType .toInternal (k ): self .valueType .toInternal (v ) for k , v in obj .items ()}
654654
655655 def fromInternal (self , obj : dict [T , Optional [U ]]) -> dict [T , Optional [U ]]: # noqa: D102
656656 if not self .needConversion ():
657657 return obj
658- return obj and dict (( self .keyType .fromInternal (k ), self .valueType .fromInternal (v )) for k , v in obj .items ())
658+ return obj and { self .keyType .fromInternal (k ): self .valueType .fromInternal (v ) for k , v in obj .items ()}
659659
660660
661661class StructField (DataType ):
@@ -1031,16 +1031,16 @@ def __eq__(self, other: object) -> bool:
10311031 TimestampNTZType ,
10321032 NullType ,
10331033]
1034- _all_atomic_types : dict [str , type [DataType ]] = dict (( t .typeName (), t ) for t in _atomic_types )
1034+ _all_atomic_types : dict [str , type [DataType ]] = { t .typeName (): t for t in _atomic_types }
10351035
10361036_complex_types : list [type [Union [ArrayType , MapType , StructType ]]] = [
10371037 ArrayType ,
10381038 MapType ,
10391039 StructType ,
10401040]
1041- _all_complex_types : dict [str , type [Union [ArrayType , MapType , StructType ]]] = dict (
1042- ( v .typeName (), v ) for v in _complex_types
1043- )
1041+ _all_complex_types : dict [str , type [Union [ArrayType , MapType , StructType ]]] = {
1042+ v .typeName (): v for v in _complex_types
1043+ }
10441044
10451045
10461046_FIXED_DECIMAL = re .compile (r"decimal\(\s*(\d+)\s*,\s*(-?\d+)\s*\)" )
@@ -1164,7 +1164,7 @@ def conv(obj: Union[Row, list, dict, object]) -> Union[list, dict, object]:
11641164 elif isinstance (obj , list ):
11651165 return [conv (o ) for o in obj ]
11661166 elif isinstance (obj , dict ):
1167- return dict (( k , conv (v )) for k , v in obj .items ())
1167+ return { k : conv (v ) for k , v in obj .items ()}
11681168 else :
11691169 return obj
11701170
0 commit comments