File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -310,10 +310,10 @@ def ids(
310
310
"""Retrieve a list of all object identifiers"""
311
311
_class_instance = cls (_read_only = True , _local = True )
312
312
_count : int = 0
313
- for _data in cls ._get_all_objects (offset ):
313
+ for response in cls ._get_all_objects (offset ):
314
314
if count and _count > count :
315
315
return
316
- if _data .get ("data" ) is None :
316
+ if ( _data := response .get ("data" ) ) is None :
317
317
raise RuntimeError (
318
318
f"Expected key 'data' for retrieval of { _class_instance .__class__ .__name__ .lower ()} s"
319
319
)
Original file line number Diff line number Diff line change @@ -333,7 +333,10 @@ def _get_folder_id_from_path(self, path: str) -> str | None:
333
333
"""
334
334
_ids = Folder .ids (filters = json .dumps ([f"path == { path } " ]))
335
335
336
- return _ids [0 ] if _ids else None
336
+ try :
337
+ return next (_ids )
338
+ except StopIteration :
339
+ return None
337
340
338
341
@prettify_pydantic
339
342
@pydantic .validate_call
You can’t perform that action at this time.
0 commit comments