@@ -44,8 +44,7 @@ def encode_json(
44
44
if isinstance (obj , io .IOBase ):
45
45
if file_encoding_strategy == "base64" :
46
46
return base64_encode_file (obj )
47
- else :
48
- return client .files .create (obj ).urls ["get" ]
47
+ return client .files .create (obj ).urls ["get" ]
49
48
if HAS_NUMPY :
50
49
if isinstance (obj , np .integer ): # type: ignore
51
50
return int (obj )
@@ -82,8 +81,7 @@ async def async_encode_json(
82
81
if file_encoding_strategy == "base64" :
83
82
# TODO: This should ideally use an async based file reader path.
84
83
return base64_encode_file (obj )
85
- else :
86
- return (await client .files .async_create (obj )).urls ["get" ]
84
+ return (await client .files .async_create (obj )).urls ["get" ]
87
85
if HAS_NUMPY :
88
86
if isinstance (obj , np .integer ): # type: ignore
89
87
return int (obj )
@@ -183,9 +181,9 @@ def transform_output(value: Any, client: "Client") -> Any:
183
181
def transform (obj : Any ) -> Any :
184
182
if isinstance (obj , Mapping ):
185
183
return {k : transform (v ) for k , v in obj .items ()}
186
- elif isinstance (obj , Sequence ) and not isinstance (obj , str ):
184
+ if isinstance (obj , Sequence ) and not isinstance (obj , str ):
187
185
return [transform (item ) for item in obj ]
188
- elif isinstance (obj , str ) and (
186
+ if isinstance (obj , str ) and (
189
187
obj .startswith ("https:" ) or obj .startswith ("data:" )
190
188
):
191
189
return FileOutput (obj , client )
0 commit comments