File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -1486,10 +1486,15 @@ def from_dict(dct: Dict[str, Any]) -> AbstractFileSystem:
1486
1486
1487
1487
json_decoder = FilesystemJSONDecoder ()
1488
1488
1489
- def deserialize (obj : Any ):
1489
+ def deserialize (obj : Any ) -> Any :
1490
1490
if isinstance (obj , dict ):
1491
- return json_decoder .custom_object_hook (obj )
1492
-
1491
+ obj = json_decoder .custom_object_hook (obj )
1492
+ if isinstance (obj , dict ):
1493
+ return {k : deserialize (v ) for k , v in obj .items ()}
1494
+
1495
+ if isinstance (obj , (list , tuple )):
1496
+ return [deserialize (v ) for v in obj ]
1497
+
1493
1498
return obj
1494
1499
1495
1500
dct = dict (dct ) # Defensive copy
@@ -1501,10 +1506,10 @@ def deserialize(obj: Any):
1501
1506
dct .pop ("cls" , None )
1502
1507
dct .pop ("protocol" , None )
1503
1508
1504
- args = tuple ( deserialize ( arg ) for arg in dct . pop ( "args" , ()))
1505
- kwargs = { k : deserialize (v ) for k , v in dct .items ()}
1506
-
1507
- return cls ( * args , ** kwargs )
1509
+ return cls (
1510
+ * deserialize (dct .pop ( "args" , ())),
1511
+ ** deserialize ( dct ),
1512
+ )
1508
1513
1509
1514
def _get_pyarrow_filesystem (self ):
1510
1515
"""
You can’t perform that action at this time.
0 commit comments