File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed
src/yandex_cloud_ml_sdk/_datasets Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,11 @@ async def main() -> None:
4848 print (f"New { bad_dataset = } have a bad status { bad_dataset .status = } " )
4949 await dataset .delete ()
5050
51+ # You could call .list not only on .datasets,
52+ # but on .completions helper as well, it will substitute corresponding task_type as a filter
53+ async for dataset in sdk .datasets .completions .list ():
54+ await dataset .delete ()
55+
5156 async for dataset in sdk .datasets .list ():
5257 await dataset .delete ()
5358
Original file line number Diff line number Diff line change @@ -47,6 +47,11 @@ def main() -> None:
4747 print (f"New { bad_dataset = } have a bad status { dataset .status = } " )
4848 dataset .delete ()
4949
50+ # You could call .list not only on .datasets,
51+ # but on .completions helper as well, it will substitute corresponding task_type as a filter
52+ for dataset in sdk .datasets .completions .list ():
53+ dataset .delete ()
54+
5055 for dataset in sdk .datasets .list ():
5156 dataset .delete ()
5257
Original file line number Diff line number Diff line change @@ -66,5 +66,9 @@ def draft_from_path(self):
6666 def list_upload_formats (self ):
6767 return partial (self ._domain .list_upload_formats , task_type = self ._task_type )
6868
69+ @property
70+ def list (self ):
71+ return partial (self ._domain .list , task_type = self ._task_type )
72+
6973 def __repr__ (self ) -> str :
7074 return f'{ self .__class__ .__name__ } (task_type={ self ._task_type } )'
You can’t perform that action at this time.
0 commit comments