File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed
src/yandex_cloud_ml_sdk/_utils Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,9 @@ def local_path(path: str) -> pathlib.Path:
1616
1717
1818async def main () -> None :
19+ # This example needs to have pyarrow installed
20+ import pyarrow # pylint: disable=import-outside-toplevel,unused-import
21+
1922 sdk = AsyncYCloudML (folder_id = 'b1ghsjum2v37c2un8h64' )
2023 sdk .setup_default_logging ()
2124
@@ -27,7 +30,7 @@ async def main() -> None:
2730 name = NAME ,
2831 )
2932 dataset = await dataset_draft .upload ()
30- print (f'new { dataset = } ' )
33+ print (f'Going to read { dataset = } records ' )
3134 async for record in dataset .read ():
3235 print (record )
3336
Original file line number Diff line number Diff line change @@ -15,6 +15,9 @@ def local_path(path: str) -> pathlib.Path:
1515
1616
1717def main () -> None :
18+ # This example needs to have pyarrow installed
19+ import pyarrow # pylint: disable=import-outside-toplevel,unused-import
20+
1821 sdk = YCloudML (folder_id = 'b1ghsjum2v37c2un8h64' )
1922 sdk .setup_default_logging ()
2023
@@ -26,7 +29,7 @@ def main() -> None:
2629 name = NAME ,
2730 )
2831 dataset = dataset_draft .upload ()
29- print (f'new { dataset = } ' )
32+ print (f'Going to read { dataset = } records ' )
3033 for record in dataset .read ():
3134 print (record )
3235
Original file line number Diff line number Diff line change 44from collections .abc import AsyncIterator , Iterator
55from typing import Any
66
7- import pyarrow .dataset as pd
8-
97RecordType = dict [Any , Any ]
108
119
@@ -27,6 +25,8 @@ def get_next() -> RecordType | None:
2725
2826
2927def read_dataset_records_sync (path : str , batch_size : int | None ) -> Iterator [RecordType ]:
28+ import pyarrow .dataset as pd # pylint: disable=import-outside-toplevel
29+
3030 # we need use kwargs method to preserve original default value
3131 kwargs = {}
3232 if batch_size is not None :
You can’t perform that action at this time.
0 commit comments