id int64 0 328k | repository_name stringlengths 7 58 | file_path stringlengths 9 302 | class_name stringlengths 5 256 | human_written_code stringlengths 16 2.16M | class_skeleton stringlengths 18 1.49M ⌀ | total_program_units int64 1 1.76k | total_doc_str int64 0 771 | AvgCountLine float64 0 7.89k | AvgCountLineBlank float64 0 297 | AvgCountLineCode float64 0 7.89k | AvgCountLineComment float64 0 7.89k | AvgCyclomatic float64 0 130 | CommentToCodeRatio float64 0 168 | CountClassBase float64 0 40 | CountClassCoupled float64 0 583 | CountClassCoupledModified float64 0 575 | CountClassDerived float64 0 5.35k | CountDeclInstanceMethod float64 0 529 | CountDeclInstanceVariable float64 0 296 | CountDeclMethod float64 0 599 | CountDeclMethodAll float64 0 1.12k | CountLine float64 1 40.4k | CountLineBlank float64 0 8.16k | CountLineCode float64 1 25.7k | CountLineCodeDecl float64 1 8.15k | CountLineCodeExe float64 0 24.2k | CountLineComment float64 0 16.5k | CountStmt float64 1 9.71k | CountStmtDecl float64 1 8.15k | CountStmtExe float64 0 9.69k | MaxCyclomatic float64 0 759 | MaxInheritanceTree float64 0 16 | MaxNesting float64 0 34 | SumCyclomatic float64 0 2.9k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
10,000 | ray-project/ray | python/ray/data/_internal/datasource/bigquery_datasource.py | ray.data._internal.datasource.bigquery_datasource.BigQueryDatasource | from ray.data.block import Block, BlockMetadata
from ray.data.datasource.datasource import Datasource, ReadTask
from typing import List, Optional
from ray.data._internal.util import _check_import
class BigQueryDatasource(Datasource):
def __init__(self, project_id: str, dataset: Optional[str]=None, query: Optional... |
class BigQueryDatasource(Datasource):
def __init__(self, project_id: str, dataset: Optional[str]=None, query: Optional[str]=None):
pass
def get_read_tasks(self, parallelism: int) -> List[ReadTask]:
pass
def _read_single_partition(stream) -> Block:
pass
def estima... | 6 | 0 | 21 | 2 | 19 | 0 | 2 | 0.02 | 1 | 4 | 1 | 0 | 4 | 3 | 4 | 11 | 107 | 15 | 90 | 33 | 77 | 2 | 55 | 28 | 47 | 5 | 1 | 1 | 12 |
10,001 | ray-project/ray | python/ray/data/_internal/datasource/binary_datasource.py | ray.data._internal.datasource.binary_datasource.BinaryDatasource | from ray.data.datasource.file_based_datasource import FileBasedDatasource
from ray.data._internal.arrow_block import ArrowBlockBuilder
class BinaryDatasource(FileBasedDatasource):
"""Binary datasource, for reading and writing binary files."""
_COLUMN_NAME = 'bytes'
def _read_stream(self, f: 'pyarrow.Nativ... |
class BinaryDatasource(FileBasedDatasource):
'''Binary datasource, for reading and writing binary files.'''
def _read_stream(self, f: 'pyarrow.NativeFile', path: str):
pass
def _rows_per_file(self):
pass | 3 | 1 | 5 | 1 | 4 | 0 | 1 | 0.1 | 1 | 2 | 1 | 0 | 2 | 0 | 2 | 18 | 15 | 4 | 10 | 7 | 7 | 1 | 10 | 7 | 7 | 1 | 2 | 0 | 2 |
10,002 | ray-project/ray | python/ray/data/_internal/datasource/clickhouse_datasource.py | ray.data._internal.datasource.clickhouse_datasource.ClickHouseDatasource | from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple
import math
from ray.data.datasource.datasource import Datasource, ReadTask
from ray.data._internal.util import _check_import
from ray.util.annotations import DeveloperAPI
from ray.data.block import Block, BlockAccessor, BlockMetadata
@DeveloperAP... | @DeveloperAPI
class ClickHouseDatasource(Datasource):
'''
A Ray datasource for reading from ClickHouse.
Args:
table: Fully qualified table or view identifier (e.g.,
"default.table_name").
dsn: A string in DSN (Data Source Name) HTTP format (e.g.,
"clickhouse+http://us... | 17 | 3 | 18 | 1 | 14 | 4 | 3 | 0.41 | 1 | 12 | 3 | 0 | 13 | 8 | 13 | 20 | 312 | 24 | 205 | 79 | 173 | 84 | 122 | 60 | 104 | 7 | 1 | 2 | 41 |
10,003 | ray-project/ray | python/ray/data/_internal/datasource/csv_datasink.py | ray.data._internal.datasource.csv_datasink.CSVDatasink | from ray.data.block import BlockAccessor
from typing import Any, Callable, Dict, Optional
from ray.data.datasource.file_datasink import BlockBasedFileDatasink
from ray.data.datasource.file_based_datasource import _resolve_kwargs
class CSVDatasink(BlockBasedFileDatasink):
def __init__(self, path: str, *, arrow_csv... |
class CSVDatasink(BlockBasedFileDatasink):
def __init__(self, path: str, *, arrow_csv_args_fn: Optional[Callable[[], Dict[str, Any]]]=None, arrow_csv_args: Optional[Dict[str, Any]]=None, file_format='csv', **file_datasink_kwargs):
pass
def arrow_csv_args_fn():
pass
... | 4 | 0 | 13 | 2 | 11 | 1 | 2 | 0.05 | 1 | 3 | 0 | 1 | 2 | 2 | 2 | 23 | 27 | 5 | 22 | 16 | 10 | 1 | 14 | 8 | 10 | 3 | 4 | 1 | 4 |
10,004 | ray-project/ray | python/ray/data/_internal/datasource/csv_datasource.py | ray.data._internal.datasource.csv_datasource.CSVDatasource | from typing import TYPE_CHECKING, Any, Dict, Iterator, List, Optional, Union
from ray.data.block import Block
from ray.data.datasource.file_based_datasource import FileBasedDatasource
class CSVDatasource(FileBasedDatasource):
"""CSV datasource, for reading and writing CSV files."""
_FILE_EXTENSIONS = ['csv', '... |
class CSVDatasource(FileBasedDatasource):
'''CSV datasource, for reading and writing CSV files.'''
def __init__(self, paths: Union[str, List[str]], arrow_csv_args: Optional[Dict[str, Any]]=None, **file_based_datasource_kwargs):
pass
def _read_stream(self, f: 'pyarrow.NativeFile', path: str) -> It... | 3 | 1 | 26 | 3 | 23 | 1 | 4 | 0.11 | 1 | 5 | 0 | 3 | 2 | 3 | 2 | 18 | 64 | 8 | 54 | 20 | 43 | 6 | 29 | 14 | 23 | 6 | 2 | 4 | 8 |
10,005 | ray-project/ray | python/ray/data/_internal/datasource/databricks_uc_datasource.py | ray.data._internal.datasource.databricks_uc_datasource.DatabricksUCDatasource | import numpy as np
import requests
import time
from ray.util.annotations import PublicAPI
import os
from typing import List, Optional
from ray.data.datasource.datasource import Datasource, ReadTask
import pyarrow
import json
from urllib.parse import urljoin
from ray.data.block import BlockMetadata
@PublicAPI(stability... | @PublicAPI(stability='alpha')
class DatabricksUCDatasource(Datasource):
def __init__(self, host: str, token: str, warehouse_id: str, catalog: str, schema: str, query: str):
pass
def get_read_task(task_index, parallelism):
pass
def empty_read_fn():
... | 9 | 0 | 42 | 6 | 35 | 2 | 2 | 0.04 | 1 | 9 | 2 | 0 | 3 | 9 | 3 | 10 | 165 | 26 | 134 | 50 | 118 | 5 | 74 | 38 | 66 | 6 | 1 | 2 | 14 |
10,006 | ray-project/ray | python/ray/data/_internal/datasource/delta_sharing_datasource.py | ray.data._internal.datasource.delta_sharing_datasource.DeltaSharingDatasource | from typing import List, Optional, Tuple
from json import loads
from ray.data.datasource.datasource import Datasource, ReadTask
import numpy as np
from ray.data.block import BlockMetadata
from ray.data._internal.util import _check_import
class DeltaSharingDatasource(Datasource):
def __init__(self, url: str, json_... |
class DeltaSharingDatasource(Datasource):
def __init__(self, url: str, json_predicate_hints: Optional[str]=None, limit: Optional[int]=None, version: Optional[int]=None, timestamp: Optional[str]=None):
pass
def estimate_inmemory_data_size(self) -> Optional[int]:
pass
def _read_files(self,... | 6 | 2 | 17 | 2 | 13 | 1 | 2 | 0.1 | 1 | 4 | 2 | 0 | 5 | 9 | 5 | 12 | 89 | 15 | 67 | 36 | 50 | 7 | 41 | 29 | 31 | 3 | 1 | 1 | 9 |
10,007 | ray-project/ray | python/ray/data/_internal/datasource/hudi_datasource.py | ray.data._internal.datasource.hudi_datasource.HudiDatasource | from ray.data._internal.util import _check_import
import os
from ray.data.block import BlockMetadata
from ray.data.datasource.datasource import Datasource, ReadTask
from typing import Dict, Iterator, List, Optional, Tuple
class HudiDatasource(Datasource):
"""Hudi datasource, for reading Apache Hudi table."""
... |
class HudiDatasource(Datasource):
'''Hudi datasource, for reading Apache Hudi table.'''
def __init__(self, table_uri: str, query_type: str, filters: Optional[List[Tuple[str, str, str]]]=None, hudi_options: Optional[Dict[str, str]]=None, storage_options: Optional[Dict[str, str]]=None):
pass
def ge... | 5 | 1 | 21 | 3 | 17 | 1 | 2 | 0.1 | 1 | 4 | 2 | 0 | 3 | 2 | 3 | 10 | 76 | 12 | 58 | 35 | 42 | 6 | 36 | 27 | 28 | 3 | 1 | 2 | 7 |
10,008 | ray-project/ray | python/ray/data/_internal/datasource/huggingface_datasource.py | ray.data._internal.datasource.huggingface_datasource.HuggingFaceDatasource | from ray.data.block import Block, BlockAccessor, BlockMetadata
from ray.data._internal.util import _check_pyarrow_version
from ray.data.dataset import Dataset
from ray.air.util.tensor_extensions.arrow import pyarrow_table_from_pydict
from typing import TYPE_CHECKING, Iterable, List, Optional, Union
from ray.data.dataso... |
class HuggingFaceDatasource(Datasource):
'''Hugging Face Dataset datasource, for reading from a
`Hugging Face Datasets Dataset <https://huggingface.co/docs/datasets/package_reference/main_classes#datasets.Dataset/>`_.
This Datasource implements a streamed read using a
single read task, most beneficial ... | 7 | 2 | 28 | 2 | 18 | 9 | 3 | 0.55 | 1 | 11 | 4 | 0 | 3 | 2 | 4 | 4 | 128 | 12 | 75 | 34 | 53 | 41 | 45 | 24 | 33 | 5 | 1 | 3 | 14 |
10,009 | ray-project/ray | python/ray/data/_internal/datasource/iceberg_datasource.py | ray.data._internal.datasource.iceberg_datasource.IcebergDatasource | import heapq
from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Set, Tuple, Union
from ray.data._internal.util import _check_import
from ray.data.datasource.datasource import Datasource, ReadTask
import itertools
from ray.util.annotations import DeveloperAPI
from ray.data.block import Block, BlockMe... | @DeveloperAPI
class IcebergDatasource(Datasource):
'''
Iceberg datasource to read Iceberg tables into a Ray Dataset. This module heavily
uses PyIceberg to read iceberg tables. All the routines in this class override
`ray.data.Datasource`.
'''
def __init__(self, table_identifier: str, row_filter... | 13 | 5 | 24 | 3 | 15 | 6 | 2 | 0.42 | 1 | 10 | 2 | 0 | 7 | 8 | 8 | 15 | 207 | 29 | 125 | 56 | 99 | 53 | 66 | 43 | 53 | 6 | 1 | 1 | 18 |
10,010 | ray-project/ray | python/ray/data/_internal/datasource/image_datasink.py | ray.data._internal.datasource.image_datasink.ImageDatasink | from typing import Any, Dict
import io
from ray.data.datasource.file_datasink import RowBasedFileDatasink
class ImageDatasink(RowBasedFileDatasink):
def __init__(self, path: str, column: str, file_format: str, **file_datasink_kwargs):
super().__init__(path, file_format=file_format, **file_datasink_kwargs)... |
class ImageDatasink(RowBasedFileDatasink):
def __init__(self, path: str, column: str, file_format: str, **file_datasink_kwargs):
pass
def write_row_to_file(self, row: Dict[str, Any], file: 'pyarrow.NativeFile'):
pass | 3 | 0 | 7 | 1 | 6 | 0 | 1 | 0 | 1 | 3 | 0 | 0 | 2 | 2 | 2 | 21 | 16 | 3 | 13 | 10 | 7 | 0 | 11 | 8 | 7 | 1 | 4 | 0 | 2 |
10,011 | ray-project/ray | python/ray/data/_internal/datasource/image_datasource.py | ray.data._internal.datasource.image_datasource.ImageDatasource | from ray.data._internal.util import _check_import
from ray.data.block import Block, BlockMetadata
import io
import numpy as np
from ray.data.datasource.file_based_datasource import FileBasedDatasource
from typing import TYPE_CHECKING, Iterator, List, Optional, Tuple, Union
from ray.data._internal.delegating_block_build... |
class ImageDatasource(FileBasedDatasource):
'''A datasource that lets you read images.'''
def __init__(self, paths: Union[str, List[str]], size: Optional[Tuple[int, int]]=None, mode: Optional[str]=None, **file_based_datasource_kwargs):
pass
def _read_stream(self, f: 'pyarrow.NativeFile', path: st... | 6 | 2 | 23 | 2 | 19 | 2 | 4 | 0.11 | 1 | 10 | 2 | 0 | 5 | 3 | 5 | 21 | 126 | 18 | 97 | 44 | 80 | 11 | 69 | 33 | 62 | 7 | 2 | 2 | 19 |
10,012 | ray-project/ray | python/ray/data/_internal/datasource/image_datasource.py | ray.data._internal.datasource.image_datasource.ImageFileMetadataProvider | from ray.data.block import Block, BlockMetadata
from typing import TYPE_CHECKING, Iterator, List, Optional, Tuple, Union
from ray.data.datasource.file_meta_provider import DefaultFileMetadataProvider
class ImageFileMetadataProvider(DefaultFileMetadataProvider):
def _set_encoding_ratio(self, encoding_ratio: int):
... |
class ImageFileMetadataProvider(DefaultFileMetadataProvider):
def _set_encoding_ratio(self, encoding_ratio: int):
'''Set image file encoding ratio, to provide accurate size in bytes metadata.'''
pass
def _get_block_metadata(self, paths: List[str], *, rows_per_file: Optional[int], file_sizes: ... | 3 | 1 | 9 | 0 | 8 | 1 | 2 | 0.06 | 1 | 5 | 1 | 0 | 2 | 1 | 2 | 8 | 19 | 1 | 17 | 12 | 7 | 1 | 8 | 5 | 5 | 2 | 3 | 1 | 3 |
10,013 | ray-project/ray | python/ray/data/_internal/datasource/json_datasink.py | ray.data._internal.datasource.json_datasink.JSONDatasink | from typing import Any, Callable, Dict, Optional
from ray.data.datasource.file_based_datasource import _resolve_kwargs
from ray.data.datasource.file_datasink import BlockBasedFileDatasink
from ray.data.block import BlockAccessor
class JSONDatasink(BlockBasedFileDatasink):
def __init__(self, path: str, *, pandas_j... |
class JSONDatasink(BlockBasedFileDatasink):
def __init__(self, path: str, *, pandas_json_args_fn: Optional[Callable[[], Dict[str, Any]]]=None, pandas_json_args: Optional[Dict[str, Any]]=None, file_format: str='json', **file_datasink_kwargs):
pass
def pandas_json_args_fn():
... | 4 | 0 | 13 | 2 | 11 | 1 | 2 | 0.05 | 1 | 3 | 0 | 0 | 2 | 2 | 2 | 23 | 27 | 5 | 22 | 16 | 11 | 1 | 14 | 8 | 11 | 3 | 4 | 1 | 4 |
10,014 | ray-project/ray | python/ray/data/_internal/datasource/lance_datasink.py | ray.data._internal.datasource.lance_datasink.LanceDatasink | import pickle
import pyarrow as pa
from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Literal, Optional, Tuple, Union
class LanceDatasink(_BaseLanceDatasink):
"""Lance Ray Datasink.
Write a Ray dataset to lance.
If we expect to write larger-than-memory files,
we can use `LanceFragmentWriter... |
class LanceDatasink(_BaseLanceDatasink):
'''Lance Ray Datasink.
Write a Ray dataset to lance.
If we expect to write larger-than-memory files,
we can use `LanceFragmentWriter` and `LanceCommitter`.
Args:
uri : the base URI of the dataset.
schema : pyarrow.Schema, optional.
... | 6 | 1 | 11 | 0 | 11 | 0 | 1 | 0.48 | 1 | 4 | 0 | 0 | 4 | 5 | 4 | 17 | 77 | 9 | 46 | 27 | 26 | 22 | 14 | 10 | 9 | 1 | 3 | 0 | 4 |
10,015 | ray-project/ray | python/ray/data/_internal/datasource/lance_datasink.py | ray.data._internal.datasource.lance_datasink._BaseLanceDatasink | import pickle
from ray.data.datasource.datasink import Datasink
from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Literal, Optional, Tuple, Union
from ray.data._internal.util import _check_import
import pyarrow as pa
class _BaseLanceDatasink(Datasink):
"""Base class for Lance Datasink."""
def __ini... |
class _BaseLanceDatasink(Datasink):
'''Base class for Lance Datasink.'''
def __init__(self, uri: str, schema: Optional[pa.Schema]=None, mode: Literal['create', 'append', 'overwrite']='create', storage_options: Optional[Dict[str, Any]]=None, *args, **kwargs):
pass
@property
def supports_distrib... | 6 | 1 | 18 | 2 | 16 | 1 | 4 | 0.05 | 1 | 6 | 0 | 1 | 4 | 5 | 4 | 13 | 80 | 11 | 66 | 32 | 46 | 3 | 42 | 20 | 34 | 9 | 2 | 2 | 14 |
10,016 | ray-project/ray | python/ray/data/_internal/datasource/lance_datasource.py | ray.data._internal.datasource.lance_datasource.LanceDatasource | from ray.data.block import BlockMetadata
from ray.data.context import DataContext
from typing import TYPE_CHECKING, Any, Dict, Iterator, List, Optional
from ray.data.datasource.datasource import Datasource, ReadTask
from ray.data._internal.util import _check_import, call_with_retry
import numpy as np
class LanceDataso... |
class LanceDatasource(Datasource):
'''Lance datasource, for reading Lance dataset.'''
def __init__(self, uri: str, columns: Optional[List[str]]=None, filter: Optional[str]=None, storage_options: Optional[Dict[str, str]]=None, scanner_options: Optional[Dict[str, Any]]=None):
pass
def get_read_task... | 4 | 1 | 23 | 2 | 20 | 1 | 2 | 0.09 | 1 | 6 | 3 | 0 | 3 | 5 | 3 | 10 | 81 | 11 | 64 | 31 | 52 | 6 | 36 | 24 | 31 | 3 | 1 | 2 | 7 |
10,017 | ray-project/ray | python/ray/data/_internal/datasource/mongo_datasink.py | ray.data._internal.datasource.mongo_datasink.MongoDatasink | from typing import Iterable
from ray.data._internal.util import _check_import
from ray.data._internal.datasource.mongo_datasource import _validate_database_collection_exist
from ray.data.datasource.datasink import Datasink
from ray.data._internal.delegating_block_builder import DelegatingBlockBuilder
from ray.data.bloc... |
class MongoDatasink(Datasink[None]):
def __init__(self, uri: str, database: str, collection: str) -> None:
pass
def write(self, blocks: Iterable[Block], ctx: TaskContext) -> None:
pass
def write_block(uri: str, database: str, collection: str, block: Block):
pass | 4 | 0 | 12 | 2 | 10 | 0 | 1 | 0 | 1 | 2 | 1 | 0 | 2 | 3 | 2 | 11 | 33 | 7 | 26 | 16 | 16 | 0 | 20 | 12 | 14 | 2 | 2 | 1 | 4 |
10,018 | ray-project/ray | python/ray/data/_internal/datasource/mongo_datasource.py | ray.data._internal.datasource.mongo_datasource.MongoDatasource | from ray.data.block import Block, BlockMetadata
from ray.data.datasource.datasource import Datasource, ReadTask
from typing import TYPE_CHECKING, Dict, List, Optional
class MongoDatasource(Datasource):
"""Datasource for reading from and writing to MongoDB."""
def __init__(self, uri: str, database: str, collec... |
class MongoDatasource(Datasource):
'''Datasource for reading from and writing to MongoDB.'''
def __init__(self, uri: str, database: str, collection: str, pipeline: Optional[List[Dict]]=None, schema: Optional['pymongoarrow.api.Schema']=None, **mongo_args):
pass
def estimate_inmemory_data_size(self... | 7 | 1 | 24 | 1 | 21 | 1 | 2 | 0.05 | 1 | 7 | 1 | 0 | 5 | 8 | 5 | 12 | 119 | 12 | 102 | 47 | 73 | 5 | 42 | 29 | 31 | 2 | 1 | 1 | 11 |
10,019 | ray-project/ray | python/ray/data/_internal/datasource/numpy_datasink.py | ray.data._internal.datasource.numpy_datasink.NumpyDatasink | from ray.data.datasource.file_datasink import BlockBasedFileDatasink
import numpy as np
from ray.data.block import BlockAccessor
class NumpyDatasink(BlockBasedFileDatasink):
def __init__(self, path: str, column: str, *, file_format: str='npy', **file_datasink_kwargs):
super().__init__(path, file_format=fi... |
class NumpyDatasink(BlockBasedFileDatasink):
def __init__(self, path: str, column: str, *, file_format: str='npy', **file_datasink_kwargs):
pass
def write_block_to_file(self, block: BlockAccessor, file: 'pyarrow.NativeFile'):
pass | 3 | 0 | 7 | 1 | 7 | 0 | 1 | 0 | 1 | 2 | 0 | 0 | 2 | 1 | 2 | 23 | 16 | 2 | 14 | 12 | 4 | 0 | 7 | 5 | 4 | 1 | 4 | 0 | 2 |
10,020 | ray-project/ray | python/ray/data/_internal/datasource/numpy_datasource.py | ray.data._internal.datasource.numpy_datasource.NumpyDatasource | from ray.data.datasource.file_based_datasource import FileBasedDatasource
from io import BytesIO
from typing import TYPE_CHECKING, Any, Dict, Iterator, List, Optional, Union
from ray.data.block import Block, BlockAccessor
import numpy as np
class NumpyDatasource(FileBasedDatasource):
"""Numpy datasource, for readi... |
class NumpyDatasource(FileBasedDatasource):
'''Numpy datasource, for reading and writing Numpy files.'''
def __init__(self, paths: Union[str, List[str]], numpy_load_args: Optional[Dict[str, Any]]=None, **file_based_datasource_kwargs):
pass
def _read_stream(self, f: 'pyarrow.NativeFile', path: str... | 3 | 1 | 11 | 1 | 9 | 1 | 2 | 0.14 | 1 | 4 | 1 | 0 | 2 | 1 | 2 | 18 | 29 | 5 | 21 | 13 | 13 | 3 | 14 | 8 | 11 | 2 | 2 | 1 | 3 |
10,021 | ray-project/ray | python/ray/data/_internal/datasource/parquet_bulk_datasource.py | ray.data._internal.datasource.parquet_bulk_datasource.ParquetBulkDatasource | from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union
from ray.data.datasource.file_based_datasource import FileBasedDatasource
class ParquetBulkDatasource(FileBasedDatasource):
"""Minimal Parquet datasource, for reading and writing Parquet files."""
_FILE_EXTENSIONS = ['parquet']
def __init_... |
class ParquetBulkDatasource(FileBasedDatasource):
'''Minimal Parquet datasource, for reading and writing Parquet files.'''
def __init__(self, paths: Union[str, List[str]], read_table_args: Optional[Dict[str, Any]]=None, **file_based_datasource_kwargs):
pass
def get_name(self):
'''Return a... | 5 | 2 | 8 | 1 | 6 | 1 | 1 | 0.24 | 1 | 3 | 0 | 0 | 4 | 1 | 4 | 20 | 39 | 8 | 25 | 19 | 9 | 6 | 15 | 9 | 9 | 2 | 2 | 1 | 5 |
10,022 | ray-project/ray | python/ray/data/_internal/datasource/parquet_datasink.py | ray.data._internal.datasource.parquet_datasink.ParquetDatasink | from ray.data.datasource.file_datasink import _FileDatasink
from pathlib import Path
from ray.data.datasource.file_based_datasource import _resolve_kwargs
from ray.data.block import Block, BlockAccessor
from ray.data._internal.savemode import SaveMode
from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, Lis... |
class ParquetDatasink(_FileDatasink):
def __init__(self, path: str, *, partition_cols: Optional[List[str]]=None, arrow_parquet_args_fn: Optional[Callable[[], Dict[str, Any]]]=None, arrow_parquet_args: Optional[Dict[str, Any]]=None, min_rows_per_file: Optional[int]=None, max_rows_per_file: Optional[int]=None, file... | 9 | 0 | 26 | 2 | 22 | 2 | 2 | 0.1 | 1 | 10 | 1 | 0 | 5 | 4 | 5 | 22 | 150 | 17 | 123 | 66 | 82 | 12 | 58 | 32 | 47 | 3 | 3 | 3 | 13 |
10,023 | ray-project/ray | python/ray/data/_internal/datasource/parquet_datasource.py | ray.data._internal.datasource.parquet_datasource.ParquetDatasource | from ray.util.debug import log_once
from ray.data.block import Block, BlockAccessor, BlockMetadata
from ray.data.datasource.path_util import _has_file_extension, _resolve_paths_and_filesystem
from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, Iterator, List, Literal, Optional, Tuple, Union
from ray.data._... |
class ParquetDatasource(Datasource):
'''Parquet datasource, for reading and writing Parquet files.
The primary difference from ParquetBulkDatasource is that this uses
PyArrow's `ParquetDataset` abstraction for dataset reads, and thus offers
automatic Arrow dataset schema inference and row count collect... | 11 | 2 | 53 | 5 | 41 | 7 | 6 | 0.2 | 1 | 19 | 8 | 0 | 5 | 17 | 5 | 5 | 280 | 33 | 206 | 69 | 182 | 41 | 99 | 44 | 92 | 18 | 1 | 3 | 29 |
10,024 | ray-project/ray | python/ray/data/_internal/datasource/range_datasource.py | ray.data._internal.datasource.range_datasource.RangeDatasource | from ray.data.block import Block, BlockAccessor, BlockMetadata
from ray.data.context import DataContext
import functools
import numpy as np
import builtins
from ray.data._internal.util import _check_pyarrow_version
from typing import Iterable, List, Optional, Tuple
from ray.data.datasource import Datasource, ReadTask
... |
class RangeDatasource(Datasource):
'''An example datasource that generates ranges of numbers from [0..n).'''
def __init__(self, n: int, block_format: str='arrow', tensor_shape: Tuple=(1,), column_name:
pass
def estimate_inmemory_data_size(self) -> Optional[int]:
pass
def get_read_tas... | 8 | 1 | 25 | 2 | 22 | 1 | 3 | 0.06 | 1 | 10 | 4 | 0 | 4 | 4 | 4 | 4 | 126 | 14 | 106 | 44 | 83 | 6 | 61 | 32 | 50 | 6 | 1 | 1 | 19 |
10,025 | ray-project/ray | python/ray/data/_internal/datasource/sql_datasink.py | ray.data._internal.datasource.sql_datasink.SQLDatasink | from ray.data.datasource.datasink import Datasink
from ray.data._internal.execution.interfaces import TaskContext
from typing import Callable, Iterable
from ray.data.block import Block, BlockAccessor
from ray.data._internal.datasource.sql_datasource import Connection, _connect
class SQLDatasink(Datasink[None]):
_M... |
class SQLDatasink(Datasink[None]):
def __init__(self, sql: str, connection_factory: Callable[[], Connection]):
pass
def write(self, blocks: Iterable[Block], ctx: TaskContext) -> None:
pass | 3 | 0 | 11 | 1 | 10 | 0 | 3 | 0 | 1 | 2 | 0 | 0 | 2 | 2 | 2 | 11 | 27 | 5 | 22 | 15 | 15 | 0 | 18 | 10 | 15 | 5 | 2 | 4 | 6 |
10,026 | ray-project/ray | python/ray/data/_internal/datasource/sql_datasource.py | ray.data._internal.datasource.sql_datasource.SQLDatasource | import math
from ray.data.block import Block, BlockMetadata
from ray.data.datasource.datasource import Datasource, ReadTask
from typing import Any, Callable, Iterable, Iterator, List, Optional
class SQLDatasource(Datasource):
MIN_ROWS_PER_READ_TASK = 50
def __init__(self, sql: str, connection_factory: Callabl... |
class SQLDatasource(Datasource):
def __init__(self, sql: str, connection_factory: Callable[[], Connection], shard_hash_fn: str, shard_keys: Optional[List[str]]=None):
pass
def estimate_inmemory_data_size(self) -> Optional[int]:
pass
def supports_sharding(self, parallelism: int) -> bool:
... | 9 | 2 | 14 | 1 | 12 | 1 | 2 | 0.1 | 1 | 6 | 1 | 0 | 6 | 4 | 6 | 13 | 111 | 16 | 86 | 38 | 71 | 9 | 61 | 27 | 52 | 5 | 1 | 2 | 16 |
10,027 | ray-project/ray | python/ray/data/_internal/datasource/text_datasource.py | ray.data._internal.datasource.text_datasource.TextDatasource | from ray.data.datasource.file_based_datasource import FileBasedDatasource
from typing import TYPE_CHECKING, Iterator, List
from ray.data._internal.delegating_block_builder import DelegatingBlockBuilder
from ray.data.block import Block
class TextDatasource(FileBasedDatasource):
"""Text datasource, for reading and w... |
class TextDatasource(FileBasedDatasource):
'''Text datasource, for reading and writing text files.'''
def __init__(self, paths: List[str], *, drop_empty_lines: bool=False, encoding: str='utf-8', **file_based_datasource_kwargs):
pass
def _read_stream(self, f: 'pyarrow.NativeFile', path: str) -> It... | 3 | 1 | 13 | 2 | 11 | 0 | 2 | 0.04 | 1 | 4 | 1 | 0 | 2 | 2 | 2 | 18 | 32 | 7 | 24 | 19 | 14 | 1 | 17 | 12 | 14 | 3 | 2 | 2 | 4 |
10,028 | ray-project/ray | python/ray/data/_internal/datasource/tfrecords_datasink.py | ray.data._internal.datasource.tfrecords_datasink.TFRecordDatasink | from typing import TYPE_CHECKING, Dict, Iterable, Optional, Union
from ray.data.block import BlockAccessor
from ray.data._internal.util import _check_import
from ray.data.datasource.file_datasink import BlockBasedFileDatasink
class TFRecordDatasink(BlockBasedFileDatasink):
def __init__(self, path: str, *, tf_sche... |
class TFRecordDatasink(BlockBasedFileDatasink):
def __init__(self, path: str, *, tf_schema: Optional['schema_pb2.Schema']=None, file_format: str='tar', **file_datasink_kwargs):
pass
def write_block_to_file(self, block: BlockAccessor, file: 'pyarrow.NativeFile'):
pass | 3 | 0 | 13 | 3 | 8 | 3 | 2 | 0.29 | 1 | 2 | 0 | 0 | 2 | 1 | 2 | 23 | 28 | 6 | 17 | 14 | 7 | 5 | 10 | 7 | 7 | 2 | 4 | 1 | 3 |
10,029 | ray-project/ray | python/ray/data/_internal/datasource/tfrecords_datasource.py | ray.data._internal.datasource.tfrecords_datasource.TFRecordDatasource | from ray.air.util.tensor_extensions.arrow import pyarrow_table_from_pydict
from ray.data.block import Block
from ray.data.datasource.file_based_datasource import FileBasedDatasource
from typing import TYPE_CHECKING, Dict, Iterable, Iterator, List, Optional, Union
import pyarrow
class TFRecordDatasource(FileBasedDataso... |
class TFRecordDatasource(FileBasedDatasource):
'''TFRecord datasource, for reading and writing TFRecord files.'''
def __init__(self, paths: Union[str, List[str]], tf_schema: Optional['schema_pb2.Schema']=None, tfx_read_options: Optional['TFXReadOptions']=None, **file_based_datasource_kwargs):
'''
... | 6 | 2 | 20 | 2 | 15 | 2 | 4 | 0.15 | 1 | 8 | 1 | 0 | 5 | 2 | 5 | 21 | 108 | 18 | 78 | 34 | 59 | 12 | 57 | 24 | 46 | 8 | 2 | 2 | 20 |
10,030 | ray-project/ray | python/ray/data/_internal/datasource/tfrecords_datasource.py | ray.data._internal.datasource.tfrecords_datasource.TFXReadOptions | from dataclasses import dataclass
from ray.util.annotations import PublicAPI
@PublicAPI(stability='alpha')
@dataclass
class TFXReadOptions:
"""
Specifies read options when reading TFRecord files with TFX.
"""
batch_size: int = 2048
auto_infer_schema: bool = True | @PublicAPI(stability='alpha')
@dataclass
class TFXReadOptions:
'''
Specifies read options when reading TFRecord files with TFX.
'''
pass | 3 | 1 | 0 | 0 | 0 | 0 | 0 | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 14 | 2 | 3 | 3 | 2 | 9 | 3 | 3 | 2 | 0 | 0 | 0 | 0 |
10,031 | ray-project/ray | python/ray/data/_internal/datasource/tfrecords_datasource.py | ray.data._internal.datasource.tfrecords_datasource._MaxListSize | from ray.data.aggregate import AggregateFn
from typing import TYPE_CHECKING, Dict, Iterable, Iterator, List, Optional, Union
class _MaxListSize(AggregateFn):
def __init__(self, columns: List[str]):
self._columns = columns
super().__init__(init=self._init, merge=self._merge, accumulate_row=self._ac... |
class _MaxListSize(AggregateFn):
def __init__(self, columns: List[str]):
pass
def _init(self, k: str):
pass
def _merge(self, acc1: Dict[str, int], acc2: Dict[str, int]):
pass
def _accumulate_row(self, acc: Dict[str, int], row: 'pd.Series'):
pass | 5 | 0 | 6 | 1 | 6 | 0 | 2 | 0 | 1 | 3 | 0 | 0 | 4 | 1 | 4 | 6 | 28 | 5 | 23 | 10 | 18 | 0 | 17 | 10 | 12 | 3 | 1 | 2 | 7 |
10,032 | ray-project/ray | python/ray/data/_internal/datasource/torch_datasource.py | ray.data._internal.datasource.torch_datasource.TorchDatasource | from ray.data.block import BlockMetadata
from ray.data.datasource.datasource import Datasource, ReadTask
class TorchDatasource(Datasource):
"""Torch datasource, for reading from `Torch
datasets <https://pytorch.org/docs/stable/data.html/>`_.
This datasource implements a streaming read using a single read t... |
class TorchDatasource(Datasource):
'''Torch datasource, for reading from `Torch
datasets <https://pytorch.org/docs/stable/data.html/>`_.
This datasource implements a streaming read using a single read task.
'''
def __init__(self, dataset: 'torch.utils.data.Dataset'):
pass
def get_read... | 4 | 1 | 8 | 1 | 8 | 0 | 1 | 0.17 | 1 | 2 | 2 | 0 | 3 | 1 | 3 | 10 | 33 | 5 | 24 | 10 | 17 | 4 | 10 | 7 | 6 | 1 | 1 | 0 | 3 |
10,033 | ray-project/ray | python/ray/data/_internal/datasource/video_datasource.py | ray.data._internal.datasource.video_datasource.VideoDatasource | from ray.data.datasource.file_based_datasource import FileBasedDatasource
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union
from ray.data._internal.delegating_block_builder import DelegatingBlockBuilder
from ray.data._internal.util import _check_import
class VideoDatasource(FileBasedDatasource):
_... |
class VideoDatasource(FileBasedDatasource):
def __init__(self, paths: Union[str, List[str]], include_timestamps=False, decord_load_args: Optional[Dict[str, Any]]=None, **file_based_datasource_kwargs):
pass
def _read_stream(self, f: 'pyarrow.NativeFile', path: str):
pass | 3 | 0 | 9 | 2 | 8 | 0 | 2 | 0 | 1 | 4 | 1 | 0 | 2 | 0 | 2 | 18 | 46 | 5 | 41 | 13 | 33 | 0 | 13 | 9 | 9 | 2 | 2 | 1 | 3 |
10,034 | ray-project/ray | python/ray/data/_internal/datasource/webdataset_datasink.py | ray.data._internal.datasource.webdataset_datasink.WebDatasetDatasink | import uuid
import time
from typing import Optional, Union
import io
from ray.data.block import BlockAccessor
import tarfile
from ray.data.datasource.file_datasink import BlockBasedFileDatasink
from ray.data._internal.datasource.webdataset_datasource import _apply_list, _default_encoder, _make_iterable
class WebDatase... |
class WebDatasetDatasink(BlockBasedFileDatasink):
def __init__(self, path: str, encoder: Optional[Union[bool, str, callable, list]]=True, *, file_format: str='tar', **file_datasink_kwargs):
pass
def write_block_to_file(self, block: BlockAccessor, file: 'pyarrow.NativeFile'):
pass | 3 | 0 | 17 | 1 | 17 | 0 | 5 | 0 | 1 | 7 | 0 | 0 | 2 | 1 | 2 | 23 | 36 | 2 | 34 | 17 | 24 | 0 | 27 | 10 | 24 | 8 | 4 | 3 | 9 |
10,035 | ray-project/ray | python/ray/data/_internal/datasource/webdataset_datasource.py | ray.data._internal.datasource.webdataset_datasource.WebDatasetDatasource | from ray.data.datasource.file_based_datasource import FileBasedDatasource
import json
from ray.data._internal.util import iterate_with_retry
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Union
class WebDatasetDatasource(FileBasedDatasource):
"""A Datasource for WebDataset datasets (tar for... |
class WebDatasetDatasource(FileBasedDatasource):
'''A Datasource for WebDataset datasets (tar format with naming conventions).'''
def __init__(self, paths: Union[str, List[str]], decoder: Optional[Union[bool, str, callable, list]]=True, fileselect: Optional[Union[bool, callable, list]]=None, filerename: Optio... | 4 | 2 | 29 | 3 | 21 | 5 | 4 | 0.27 | 1 | 8 | 0 | 0 | 2 | 6 | 2 | 18 | 86 | 11 | 59 | 27 | 44 | 16 | 30 | 17 | 25 | 10 | 2 | 4 | 12 |
10,036 | ray-project/ray | python/ray/data/_internal/delegating_block_builder.py | ray.data._internal.delegating_block_builder.DelegatingBlockBuilder | import collections
from ray.data._internal.arrow_block import ArrowBlockBuilder
from ray.data._internal.block_builder import BlockBuilder
from typing import Any, Mapping, Optional
from ray.data.block import Block, BlockAccessor, BlockType, DataBatch
class DelegatingBlockBuilder(BlockBuilder):
def __init__(self):
... |
class DelegatingBlockBuilder(BlockBuilder):
def __init__(self):
pass
@property
def _inferred_block_type(self) -> Optional[BlockType]:
'''The block type inferred from the first item added to the builder.'''
pass
def add(self, item: Mapping[str, Any]) -> None:
pass
... | 11 | 2 | 6 | 0 | 5 | 1 | 2 | 0.14 | 1 | 5 | 1 | 0 | 9 | 2 | 9 | 19 | 68 | 12 | 49 | 16 | 38 | 7 | 43 | 15 | 33 | 3 | 2 | 2 | 18 |
10,037 | ray-project/ray | python/ray/data/_internal/execution/autoscaling_requester.py | ray.data._internal.execution.autoscaling_requester.AutoscalingRequester | import ray
from typing import Dict, List
import threading
import time
import math
@ray.remote(num_cpus=0, max_restarts=-1, max_task_retries=-1)
class AutoscalingRequester:
"""Actor to make resource requests to autoscaler for the datasets.
The resource requests are set to timeout after RESOURCE_REQUEST_TIMEOUT... | @ray.remote(num_cpus=0, max_restarts=-1, max_task_retries=-1)
class AutoscalingRequester:
'''Actor to make resource requests to autoscaler for the datasets.
The resource requests are set to timeout after RESOURCE_REQUEST_TIMEOUT seconds.
For those live requests, we keep track of the last request made for ea... | 10 | 2 | 10 | 1 | 7 | 3 | 2 | 0.51 | 0 | 3 | 0 | 0 | 6 | 4 | 6 | 6 | 84 | 13 | 47 | 22 | 38 | 24 | 42 | 22 | 33 | 4 | 0 | 2 | 16 |
10,038 | ray-project/ray | python/ray/data/_internal/execution/backpressure_policy/backpressure_policy.py | ray.data._internal.execution.backpressure_policy.backpressure_policy.BackpressurePolicy | from typing import TYPE_CHECKING, Optional
from abc import ABC
from ray.data.context import DataContext
class BackpressurePolicy(ABC):
"""Interface for back pressure policies."""
def __init__(self, data_context: DataContext, topology: 'Topology', resource_manager: 'ResourceManager'):
"""Initialize the... |
class BackpressurePolicy(ABC):
'''Interface for back pressure policies.'''
def __init__(self, data_context: DataContext, topology: 'Topology', resource_manager: 'ResourceManager'):
'''Initialize the backpressure policy.
Args:
data_context: The data context.
topology: Th... | 4 | 4 | 7 | 1 | 2 | 4 | 1 | 1.33 | 1 | 1 | 0 | 2 | 2 | 0 | 2 | 22 | 18 | 4 | 6 | 4 | 2 | 8 | 5 | 3 | 2 | 1 | 4 | 0 | 2 |
10,039 | ray-project/ray | python/ray/data/_internal/execution/backpressure_policy/concurrency_cap_backpressure_policy.py | ray.data._internal.execution.backpressure_policy.concurrency_cap_backpressure_policy.ConcurrencyCapBackpressurePolicy | from .backpressure_policy import BackpressurePolicy
from ray.data._internal.execution.operators.task_pool_map_operator import TaskPoolMapOperator
class ConcurrencyCapBackpressurePolicy(BackpressurePolicy):
"""A backpressure policy that caps the concurrency of each operator.
The policy will limit the number of... |
class ConcurrencyCapBackpressurePolicy(BackpressurePolicy):
'''A backpressure policy that caps the concurrency of each operator.
The policy will limit the number of concurrently running tasks based on its
concurrency cap parameter.
NOTE: Only support setting concurrency cap for `TaskPoolMapOperator` fo... | 3 | 1 | 8 | 1 | 7 | 0 | 2 | 0.43 | 1 | 4 | 1 | 0 | 2 | 1 | 2 | 24 | 26 | 6 | 14 | 5 | 11 | 6 | 10 | 5 | 7 | 3 | 5 | 2 | 4 |
10,040 | ray-project/ray | python/ray/data/_internal/execution/bundle_queue/bundle_queue.py | ray.data._internal.execution.bundle_queue.bundle_queue.BundleQueue | import abc
from typing import TYPE_CHECKING, Optional
class BundleQueue(abc.ABC):
@abc.abstractmethod
def __len__(self) -> int:
"""Return the number of bundles in the queue."""
...
@abc.abstractmethod
def __contains__(self, bundle: 'RefBundle') -> bool:
"""Return whether the b... |
class BundleQueue(abc.ABC):
@abc.abstractmethod
def __len__(self) -> int:
'''Return the number of bundles in the queue.'''
pass
@abc.abstractmethod
def __contains__(self, bundle: 'RefBundle') -> bool:
'''Return whether the bundle is in the queue.'''
pass
@abc.abstra... | 21 | 10 | 4 | 0 | 2 | 2 | 1 | 0.57 | 1 | 2 | 0 | 1 | 9 | 0 | 9 | 29 | 55 | 11 | 28 | 19 | 9 | 16 | 19 | 10 | 9 | 1 | 4 | 0 | 9 |
10,041 | ray-project/ray | python/ray/data/_internal/execution/bundle_queue/fifo_bundle_queue.py | ray.data._internal.execution.bundle_queue.fifo_bundle_queue.FIFOBundleQueue | from typing import TYPE_CHECKING, Dict, List, Optional
from .bundle_queue import BundleQueue
from collections import defaultdict, deque
class FIFOBundleQueue(BundleQueue):
"""A bundle queue that follows a first-in-first-out policy."""
def __init__(self):
self._head: Optional[_Node] = None
self... |
class FIFOBundleQueue(BundleQueue):
'''A bundle queue that follows a first-in-first-out policy.'''
def __init__(self):
pass
def __len__(self) -> int:
pass
def __contains__(self, bundle: 'RefBundle') -> bool:
pass
def add(self, bundle: 'RefBundle') -> None:
'''Add... | 12 | 5 | 10 | 1 | 7 | 2 | 2 | 0.32 | 1 | 5 | 1 | 0 | 10 | 5 | 10 | 39 | 112 | 22 | 68 | 19 | 57 | 22 | 61 | 19 | 50 | 6 | 5 | 1 | 18 |
10,042 | ray-project/ray | python/ray/data/_internal/execution/bundle_queue/fifo_bundle_queue.py | ray.data._internal.execution.bundle_queue.fifo_bundle_queue._Node | from dataclasses import dataclass
from typing import TYPE_CHECKING, Dict, List, Optional
@dataclass
class _Node:
value: 'RefBundle'
next: Optional['_Node'] = None
prev: Optional['_Node'] = None | @dataclass
class _Node:
pass | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 0 | 4 | 2 | 3 | 0 | 4 | 2 | 3 | 0 | 0 | 0 | 0 |
10,043 | ray-project/ray | python/ray/data/_internal/execution/execution_callback.py | ray.data._internal.execution.execution_callback.ExecutionCallback | class ExecutionCallback:
"""Callback interface for execution events."""
def before_execution_starts(self, executor: 'StreamingExecutor'):
"""Called before the Dataset execution starts."""
...
def on_execution_step(self, executor: 'StreamingExecutor'):
"""Called at each step of the ... | class ExecutionCallback:
'''Callback interface for execution events.'''
def before_execution_starts(self, executor: 'StreamingExecutor'):
'''Called before the Dataset execution starts.'''
pass
def on_execution_step(self, executor: 'StreamingExecutor'):
'''Called at each step of the... | 5 | 5 | 3 | 0 | 2 | 1 | 1 | 0.57 | 0 | 1 | 0 | 1 | 3 | 0 | 3 | 3 | 14 | 3 | 7 | 4 | 3 | 4 | 7 | 4 | 3 | 1 | 0 | 0 | 3 |
10,044 | ray-project/ray | python/ray/data/_internal/execution/interfaces/execution_options.py | ray.data._internal.execution.interfaces.execution_options.ExecutionOptions | import os
from .common import NodeIdStr
from typing import Any, Dict, List, Optional, Union
from ray.util.annotations import DeveloperAPI
@DeveloperAPI
class ExecutionOptions:
"""Common options for execution.
Some options may not be supported on all executors (e.g., resource limits).
Attributes:
... | @DeveloperAPI
class ExecutionOptions:
'''Common options for execution.
Some options may not be supported on all executors (e.g., resource limits).
Attributes:
resource_limits: Set a soft limit on the resource usage during execution.
Autodetected by default.
exclude_resources: Amo... | 10 | 3 | 9 | 0 | 9 | 1 | 2 | 0.51 | 0 | 6 | 1 | 0 | 6 | 6 | 6 | 6 | 91 | 8 | 55 | 24 | 38 | 28 | 26 | 14 | 19 | 4 | 0 | 2 | 11 |
10,045 | ray-project/ray | python/ray/data/_internal/execution/interfaces/execution_options.py | ray.data._internal.execution.interfaces.execution_options.ExecutionResources | from typing import Any, Dict, List, Optional, Union
from ray.data._internal.execution.util import memory_string
class ExecutionResources:
"""Specifies resources usage or resource limits for execution.
By default this class represents resource usage. Use `for_limits` or
set `default_to_inf` to True to crea... |
class ExecutionResources:
'''Specifies resources usage or resource limits for execution.
By default this class represents resource usage. Use `for_limits` or
set `default_to_inf` to True to create an object that represents resource limits.
'''
def __init__(self, cpu: Optional[float]=None, gpu:... | 33 | 18 | 7 | 0 | 6 | 2 | 1 | 0.31 | 0 | 4 | 0 | 0 | 19 | 4 | 22 | 22 | 198 | 26 | 131 | 51 | 84 | 41 | 60 | 27 | 37 | 3 | 0 | 1 | 31 |
10,046 | ray-project/ray | python/ray/data/_internal/execution/interfaces/executor.py | ray.data._internal.execution.interfaces.executor.Executor | from .execution_options import ExecutionOptions
from typing import ContextManager, Iterator, Optional
from .physical_operator import PhysicalOperator
from ray.data._internal.stats import DatasetStats
from abc import ABC, abstractmethod
class Executor(ContextManager, ABC):
"""Abstract class for executors, which imp... |
class Executor(ContextManager, ABC):
'''Abstract class for executors, which implement physical operator execution.
Subclasses:
StreamingExecutor
'''
def __init__(self, options: ExecutionOptions):
'''Create the executor.'''
pass
@abstractmethod
def execute(self, dag: Phy... | 9 | 5 | 8 | 1 | 3 | 4 | 1 | 1.75 | 0 | 5 | 3 | 0 | 4 | 1 | 4 | 4 | 42 | 9 | 12 | 8 | 5 | 21 | 10 | 6 | 5 | 1 | 0 | 0 | 4 |
10,047 | ray-project/ray | python/ray/data/_internal/execution/interfaces/executor.py | ray.data._internal.execution.interfaces.executor.OutputIterator | from abc import ABC, abstractmethod
from typing import ContextManager, Iterator, Optional
from .ref_bundle import RefBundle
class OutputIterator(Iterator[RefBundle], ABC):
"""Iterator used to access the output of an Executor execution.
This is a blocking iterator. Datasets guarantees that all its iterators ar... |
class OutputIterator(Iterator[RefBundle], ABC):
'''Iterator used to access the output of an Executor execution.
This is a blocking iterator. Datasets guarantees that all its iterators are
thread-safe (i.e., multiple threads can block on them at the same time).
'''
@abstractmethod
def get_next(s... | 4 | 2 | 7 | 1 | 3 | 3 | 1 | 1.44 | 1 | 3 | 1 | 1 | 3 | 1 | 3 | 3 | 29 | 7 | 9 | 5 | 5 | 13 | 9 | 5 | 5 | 2 | 1 | 1 | 4 |
10,048 | ray-project/ray | python/ray/data/_internal/execution/interfaces/op_runtime_metrics.py | ray.data._internal.execution.interfaces.op_runtime_metrics.MetricDefinition | from dataclasses import Field, dataclass, field
from typing import TYPE_CHECKING, Any, Dict, List, Optional
@dataclass(frozen=True)
class MetricDefinition:
"""Metadata for a metric.
Args:
name: The name of the metric.
description: A human-readable description of the metric, also used as the ch... | @dataclass(frozen=True)
class MetricDefinition:
'''Metadata for a metric.
Args:
name: The name of the metric.
description: A human-readable description of the metric, also used as the chart
description on the Ray Data dashboard.
metrics_group: The group of the metric, used to... | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 2.2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 18 | 2 | 5 | 2 | 4 | 11 | 5 | 2 | 4 | 0 | 0 | 0 | 0 |
10,049 | ray-project/ray | python/ray/data/_internal/execution/interfaces/op_runtime_metrics.py | ray.data._internal.execution.interfaces.op_runtime_metrics.MetricsGroup | from enum import Enum
class MetricsGroup(Enum):
INPUTS = 'inputs'
OUTPUTS = 'outputs'
TASKS = 'tasks'
OBJECT_STORE_MEMORY = 'object_store_memory'
MISC = 'misc'
ACTORS = 'actors' |
class MetricsGroup(Enum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 49 | 6 | 0 | 6 | 6 | 5 | 0 | 6 | 6 | 5 | 0 | 4 | 0 | 0 |
10,050 | ray-project/ray | python/ray/data/_internal/execution/interfaces/op_runtime_metrics.py | ray.data._internal.execution.interfaces.op_runtime_metrics.OpRuntimeMetrics | from dataclasses import Field, dataclass, field
from collections import defaultdict
import time
from ray.data._internal.execution.bundle_queue import create_bundle_queue
from ray.data._internal.memory_tracing import trace_allocation
from typing import TYPE_CHECKING, Any, Dict, List, Optional
from ray.data._internal.exe... | @dataclass
class OpRuntimeMetrics(metaclass=OpRuntimesMetricsMeta):
'''Runtime metrics for a 'PhysicalOperator'.
Metrics are updated dynamically during the execution of the Dataset.
This class can be used for either observablity or scheduling purposes.
DO NOT modify the fields of this class directly. In... | 51 | 23 | 9 | 1 | 7 | 1 | 2 | 0.12 | 1 | 12 | 5 | 0 | 22 | 8 | 23 | 37 | 448 | 48 | 357 | 121 | 290 | 43 | 166 | 80 | 140 | 5 | 3 | 3 | 42 |
10,051 | ray-project/ray | python/ray/data/_internal/execution/interfaces/op_runtime_metrics.py | ray.data._internal.execution.interfaces.op_runtime_metrics.OpRuntimesMetricsMeta | from dataclasses import Field, dataclass, field
class OpRuntimesMetricsMeta(type):
def __init__(cls, name, bases, dict):
super().__init__(name, bases, dict)
for name, value in dict.items():
if isinstance(value, Field) and value.metadata.get(_IS_FIELD_METRIC_KEY):
metric... |
class OpRuntimesMetricsMeta(type):
def __init__(cls, name, bases, dict):
pass | 2 | 0 | 18 | 1 | 11 | 6 | 3 | 0.5 | 1 | 3 | 1 | 1 | 1 | 0 | 1 | 14 | 19 | 1 | 12 | 4 | 10 | 6 | 7 | 4 | 5 | 3 | 2 | 2 | 3 |
10,052 | ray-project/ray | python/ray/data/_internal/execution/interfaces/op_runtime_metrics.py | ray.data._internal.execution.interfaces.op_runtime_metrics.RunningTaskInfo | from dataclasses import Field, dataclass, field
from ray.data._internal.execution.interfaces.ref_bundle import RefBundle
@dataclass
class RunningTaskInfo:
inputs: RefBundle
num_outputs: int
bytes_outputs: int
num_rows_produced: int
start_time: float
cum_block_gen_time: float | @dataclass
class RunningTaskInfo:
pass | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 0 | 4 | 1 | 3 | 0 | 4 | 1 | 3 | 0 | 0 | 0 | 0 |
10,053 | ray-project/ray | python/ray/data/_internal/execution/interfaces/physical_operator.py | ray.data._internal.execution.interfaces.physical_operator.DataOpTask | import ray
from ray._raylet import ObjectRefGenerator
from ray.data._internal.execution.interfaces.execution_options import ExecutionOptions, ExecutionResources
from .ref_bundle import RefBundle
from typing import TYPE_CHECKING, Any, Callable, Dict, Iterator, List, Optional, Tuple, Union
class DataOpTask(OpTask):
... |
class DataOpTask(OpTask):
'''Represents an OpTask that handles Block data.'''
def __init__(self, task_index: int, streaming_gen: ObjectRefGenerator, output_ready_callback: Callable[[RefBundle], None], task_done_callback: Callable[[Optional[Exception]], None], task_resource_bundle: Optional[ExecutionResources]... | 4 | 3 | 22 | 1 | 13 | 8 | 3 | 0.67 | 1 | 5 | 1 | 0 | 3 | 3 | 3 | 27 | 70 | 5 | 39 | 18 | 28 | 26 | 30 | 10 | 26 | 6 | 5 | 3 | 8 |
10,054 | ray-project/ray | python/ray/data/_internal/execution/interfaces/physical_operator.py | ray.data._internal.execution.interfaces.physical_operator.MetadataOpTask | from typing import TYPE_CHECKING, Any, Callable, Dict, Iterator, List, Optional, Tuple, Union
import ray
from ray.data._internal.execution.interfaces.execution_options import ExecutionOptions, ExecutionResources
class MetadataOpTask(OpTask):
"""Represents an OpTask that only handles metadata, instead of Block data... |
class MetadataOpTask(OpTask):
'''Represents an OpTask that only handles metadata, instead of Block data.'''
def __init__(self, task_index: int, object_ref: ray.ObjectRef, task_done_callback: Callable[[], None], task_resource_bundle: Optional[ExecutionResources]=None):
'''
Args:
obj... | 4 | 3 | 7 | 0 | 5 | 2 | 1 | 0.47 | 1 | 2 | 0 | 0 | 3 | 2 | 3 | 27 | 25 | 3 | 15 | 12 | 5 | 7 | 9 | 6 | 5 | 1 | 5 | 0 | 3 |
10,055 | ray-project/ray | python/ray/data/_internal/execution/interfaces/physical_operator.py | ray.data._internal.execution.interfaces.physical_operator.OpTask | from typing import TYPE_CHECKING, Any, Callable, Dict, Iterator, List, Optional, Tuple, Union
import ray
from ray._raylet import ObjectRefGenerator
from ray.data._internal.execution.interfaces.execution_options import ExecutionOptions, ExecutionResources
from abc import ABC, abstractmethod
class OpTask(ABC):
"""Ab... |
class OpTask(ABC):
'''Abstract class that represents a task that is created by an PhysicalOperator.
The task can be either a regular task or an actor task.
'''
def __init__(self, task_index: int, task_resource_bundle: Optional[ExecutionResources]=None):
pass
def task_index(self) -> int:
... | 7 | 3 | 4 | 0 | 3 | 1 | 1 | 0.33 | 1 | 1 | 0 | 2 | 4 | 2 | 4 | 24 | 25 | 5 | 15 | 12 | 5 | 5 | 10 | 7 | 5 | 1 | 4 | 0 | 4 |
10,056 | ray-project/ray | python/ray/data/_internal/execution/interfaces/physical_operator.py | ray.data._internal.execution.interfaces.physical_operator.PhysicalOperator | from ray.data._internal.stats import StatsDict, Timer
from ray.data._internal.execution.interfaces.op_runtime_metrics import OpRuntimeMetrics
from ray.data._internal.output_buffer import OutputBlockSizeOption
import ray
from ray.data.context import DataContext
from ray.data._internal.actor_autoscaler.autoscaling_actor_... |
class PhysicalOperator(Operator):
'''Abstract class for physical operators.
An operator transforms one or more input streams of RefBundles into a single
output stream of RefBundles.
Physical operators are stateful and non-serializable; they live on the driver side
of the Dataset only.
Here's a ... | 58 | 41 | 7 | 1 | 3 | 4 | 1 | 1.38 | 1 | 13 | 5 | 2 | 43 | 11 | 43 | 50 | 402 | 86 | 134 | 74 | 75 | 185 | 116 | 59 | 72 | 3 | 1 | 2 | 49 |
10,057 | ray-project/ray | python/ray/data/_internal/execution/interfaces/ref_bundle.py | ray.data._internal.execution.interfaces.ref_bundle.RefBundle | from ray.data.block import Block, BlockMetadata, Schema
from .common import NodeIdStr
from ray.data.context import DataContext
from typing import Dict, Iterator, List, Optional, Tuple
import ray
from collections import defaultdict
from ray.data._internal.memory_tracing import trace_deallocation
from dataclasses import ... | @dataclass
class RefBundle:
'''A group of data block references and their metadata.
Operators take in and produce streams of RefBundles.
Most commonly a RefBundle consists of a single block object reference.
In some cases, e.g., due to block splitting, or for a reduce task, there may
be more than on... | 16 | 7 | 7 | 0 | 5 | 1 | 2 | 0.52 | 0 | 7 | 2 | 0 | 11 | 0 | 11 | 11 | 115 | 20 | 63 | 26 | 49 | 33 | 54 | 22 | 42 | 4 | 0 | 2 | 22 |
10,058 | ray-project/ray | python/ray/data/_internal/execution/interfaces/task_context.py | ray.data._internal.execution.interfaces.task_context.TaskContext | from typing import TYPE_CHECKING, Any, Dict, Optional
from ray.data._internal.progress_bar import ProgressBar
from dataclasses import dataclass, field
@dataclass
class TaskContext:
"""This describes the information of a task running block transform."""
task_idx: int
op_name: str
sub_progress_bar_dict: ... | @dataclass
class TaskContext:
'''This describes the information of a task running block transform.'''
@classmethod
def get_current(cls) -> Optional['TaskContext']:
'''Get the TaskContext for the current thread.
Returns None if no TaskContext has been set.
'''
pass
@classm... | 8 | 4 | 0 | 0 | 0 | 0 | 0 | 2.86 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 34 | 7 | 7 | 6 | 6 | 20 | 7 | 6 | 6 | 0 | 0 | 0 | 0 |
10,059 | ray-project/ray | python/ray/data/_internal/execution/operators/actor_pool_map_operator.py | ray.data._internal.execution.operators.actor_pool_map_operator.ActorPoolMapOperator | from ray.data._internal.execution.bundle_queue import create_bundle_queue
from ray.data._internal.actor_autoscaler.autoscaling_actor_pool import ActorPoolScalingRequest
import warnings
from ray.data._internal.execution.interfaces import ExecutionOptions, ExecutionResources, NodeIdStr, PhysicalOperator, RefBundle, TaskC... |
class ActorPoolMapOperator(MapOperator):
'''A MapOperator implementation that executes tasks on an actor pool.
NOTE: This class is NOT thread-safe
This class manages the state of a pool of actors used for task execution, as well
as dispatch of tasks to those actors.
It operates in two modes. In bul... | 30 | 8 | 15 | 1 | 10 | 4 | 2 | 0.4 | 1 | 11 | 5 | 0 | 19 | 11 | 20 | 71 | 347 | 35 | 223 | 74 | 184 | 89 | 133 | 57 | 109 | 4 | 5 | 2 | 40 |
10,060 | ray-project/ray | python/ray/data/_internal/execution/operators/actor_pool_map_operator.py | ray.data._internal.execution.operators.actor_pool_map_operator._ActorPool | from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union
from ray.data._internal.execution.interfaces import ExecutionOptions, ExecutionResources, NodeIdStr, PhysicalOperator, RefBundle, TaskContext
import uuid
import ray
from ray.data._internal.execution.interfaces.physical_operator import _Actor... |
class _ActorPool(AutoscalingActorPool):
'''A pool of actors for map task execution.
This class is in charge of tracking the number of in-flight tasks per actor,
providing the least heavily loaded actor to the operator, and killing idle
actors when the operator is done submitting work to the pool.
'... | 38 | 18 | 9 | 1 | 6 | 2 | 2 | 0.44 | 1 | 9 | 3 | 0 | 34 | 10 | 34 | 67 | 347 | 57 | 202 | 76 | 157 | 88 | 148 | 66 | 112 | 6 | 5 | 2 | 57 |
10,061 | ray-project/ray | python/ray/data/_internal/execution/operators/actor_pool_map_operator.py | ray.data._internal.execution.operators.actor_pool_map_operator._ActorState | from dataclasses import dataclass
@dataclass
class _ActorState:
"""Actor state"""
num_tasks_in_flight: int
actor_location: str
is_restarting: bool | @dataclass
class _ActorState:
'''Actor state'''
pass | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 3 | 4 | 1 | 3 | 4 | 4 | 1 | 3 | 0 | 0 | 0 | 0 |
10,062 | ray-project/ray | python/ray/data/_internal/execution/operators/actor_pool_map_operator.py | ray.data._internal.execution.operators.actor_pool_map_operator._MapWorker | from ray.data._internal.execution.operators.map_operator import MapOperator, _map_task
import ray
from ray.data._internal.execution.interfaces import ExecutionOptions, ExecutionResources, NodeIdStr, PhysicalOperator, RefBundle, TaskContext
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union
f... |
class _MapWorker:
'''An actor worker for MapOperator.'''
def __init__(self, ctx: DataContext, src_fn_name: str, map_transformer: MapTransformer, logical_actor_id: str, actor_location_tracker: ActorLocationTracker):
pass
def get_location(self) -> NodeIdStr:
pass
def submit(self, data_... | 6 | 2 | 8 | 0 | 6 | 2 | 1 | 0.28 | 0 | 4 | 2 | 0 | 5 | 2 | 5 | 5 | 47 | 6 | 32 | 19 | 15 | 9 | 15 | 8 | 9 | 1 | 0 | 0 | 5 |
10,063 | ray-project/ray | python/ray/data/_internal/execution/operators/aggregate_num_rows.py | ray.data._internal.execution.operators.aggregate_num_rows.AggregateNumRows | from ray.data.context import DataContext
from ray.data._internal.execution.interfaces import PhysicalOperator, RefBundle
from ray.data.block import BlockAccessor
from ray.data._internal.stats import StatsDict
import ray
from ray.data._internal.delegating_block_builder import DelegatingBlockBuilder
class AggregateNumRo... |
class AggregateNumRows(PhysicalOperator):
'''Count number of rows in input bundles.
This operator aggregates the number of rows in input bundles using the bundles'
block metadata. It outputs a single row with the specified column name.
'''
def __init__(self, input_dependencies, data_context: DataC... | 8 | 1 | 6 | 1 | 5 | 0 | 1 | 0.11 | 1 | 7 | 4 | 0 | 7 | 3 | 7 | 57 | 54 | 13 | 37 | 21 | 24 | 4 | 27 | 16 | 19 | 1 | 2 | 0 | 7 |
10,064 | ray-project/ray | python/ray/data/_internal/execution/operators/base_physical_operator.py | ray.data._internal.execution.operators.base_physical_operator.AllToAllOperator | from ray.data._internal.stats import StatsDict
from typing import List, Optional
from ray.data._internal.execution.interfaces.physical_operator import _create_sub_pb
from ray.data._internal.execution.interfaces import AllToAllTransformFn, PhysicalOperator, RefBundle, TaskContext
from ray.data.context import DataContext... |
class AllToAllOperator(InternalQueueOperatorMixin, PhysicalOperator):
'''A blocking operator that executes once its inputs are complete.
This operator implements distributed sort / shuffle operations, etc.
'''
def __init__(self, bulk_fn: AllToAllTransformFn, input_op: PhysicalOperator, data_context: D... | 16 | 4 | 7 | 0 | 6 | 1 | 1 | 0.21 | 1 | 6 | 2 | 0 | 13 | 9 | 13 | 13 | 112 | 14 | 81 | 37 | 58 | 17 | 54 | 28 | 40 | 3 | 1 | 2 | 19 |
10,065 | ray-project/ray | python/ray/data/_internal/execution/operators/base_physical_operator.py | ray.data._internal.execution.operators.base_physical_operator.NAryOperator | from ray.data._internal.execution.interfaces import AllToAllTransformFn, PhysicalOperator, RefBundle, TaskContext
from ray.data._internal.logical.interfaces import LogicalOperator
from ray.data.context import DataContext
class NAryOperator(PhysicalOperator):
"""An operator that has multiple input dependencies and ... |
class NAryOperator(PhysicalOperator):
'''An operator that has multiple input dependencies and one output.
This operator serves as the base for union, zip, etc.
'''
def __init__(self, data_context: DataContext, *input_ops: LogicalOperator):
'''Create a OneToOneOperator.
Args:
... | 2 | 2 | 15 | 0 | 10 | 5 | 1 | 0.73 | 1 | 4 | 2 | 1 | 1 | 0 | 1 | 1 | 21 | 2 | 11 | 8 | 5 | 8 | 5 | 4 | 3 | 1 | 1 | 0 | 1 |
10,066 | ray-project/ray | python/ray/data/_internal/execution/operators/base_physical_operator.py | ray.data._internal.execution.operators.base_physical_operator.OneToOneOperator | from ray.data.context import DataContext
from ray.data._internal.execution.interfaces import AllToAllTransformFn, PhysicalOperator, RefBundle, TaskContext
from typing import List, Optional
class OneToOneOperator(PhysicalOperator):
"""An operator that has one input and one output dependency.
This operator serv... |
class OneToOneOperator(PhysicalOperator):
'''An operator that has one input and one output dependency.
This operator serves as the base for map, filter, limit, etc.
'''
def __init__(self, name: str, input_op: PhysicalOperator, data_context: DataContext, target_max_block_size_override: Optional[int]=No... | 4 | 2 | 9 | 0 | 5 | 4 | 1 | 0.83 | 1 | 4 | 1 | 2 | 2 | 0 | 2 | 2 | 25 | 3 | 12 | 10 | 2 | 10 | 5 | 3 | 2 | 1 | 1 | 0 | 2 |
10,067 | ray-project/ray | python/ray/data/_internal/execution/operators/input_data_buffer.py | ray.data._internal.execution.operators.input_data_buffer.InputDataBuffer | from ray.data._internal.execution.interfaces import ExecutionOptions, PhysicalOperator, RefBundle
from ray.data._internal.stats import StatsDict
from ray.data.context import DataContext
from typing import Callable, List, Optional
class InputDataBuffer(PhysicalOperator):
"""Defines the input data for the operator D... |
class InputDataBuffer(PhysicalOperator):
'''Defines the input data for the operator DAG.
For example, this may hold cached blocks from a previous Dataset execution, or
the arguments for read tasks.
'''
def __init__(self, data_context: DataContext, input_data: Optional[List[RefBundle]]=None, input_... | 9 | 2 | 8 | 0 | 6 | 2 | 2 | 0.34 | 1 | 5 | 1 | 0 | 8 | 6 | 8 | 8 | 78 | 11 | 50 | 25 | 35 | 17 | 39 | 19 | 30 | 3 | 1 | 1 | 12 |
10,068 | ray-project/ray | python/ray/data/_internal/execution/operators/limit_operator.py | ray.data._internal.execution.operators.limit_operator.LimitOperator | from ray.types import ObjectRef
from ray.data.block import Block, BlockAccessor, BlockMetadata, BlockStats
from ray.data._internal.execution.operators.base_physical_operator import OneToOneOperator
from ray.data._internal.remote_fn import cached_remote_fn
import copy
from ray.data.context import DataContext
from ray.da... |
class LimitOperator(OneToOneOperator):
'''Physical operator for limit.'''
def __init__(self, limit: int, input_op: PhysicalOperator, data_context: DataContext):
pass
def _limit_reached(self) -> bool:
pass
def _add_input_inner(self, refs: RefBundle, input_index: int) -> None:
... | 12 | 1 | 10 | 0 | 9 | 1 | 2 | 0.13 | 1 | 12 | 7 | 0 | 10 | 7 | 10 | 12 | 117 | 12 | 93 | 34 | 76 | 12 | 72 | 29 | 60 | 6 | 2 | 2 | 19 |
10,069 | ray-project/ray | python/ray/data/_internal/execution/operators/map_operator.py | ray.data._internal.execution.operators.map_operator.MapOperator | import copy
from ray.data._internal.execution.interfaces.physical_operator import DataOpTask, MetadataOpTask, OpTask, estimate_total_num_of_blocks
from ray.data._internal.stats import StatsDict
import ray
import functools
from ray.data._internal.compute import ActorPoolStrategy, ComputeStrategy, TaskPoolStrategy
from r... |
class MapOperator(OneToOneOperator, InternalQueueOperatorMixin, ABC):
'''A streaming operator that maps input bundles 1:1 to output bundles.
This operator implements the distributed map operation, supporting both task
and actor compute strategies.
'''
def __init__(self, map_transformer: MapTransfo... | 46 | 8 | 13 | 1 | 9 | 3 | 2 | 0.39 | 2 | 21 | 10 | 2 | 28 | 16 | 29 | 51 | 428 | 59 | 266 | 118 | 184 | 103 | 168 | 74 | 130 | 7 | 4 | 3 | 55 |
10,070 | ray-project/ray | python/ray/data/_internal/execution/operators/map_operator.py | ray.data._internal.execution.operators.map_operator._BlockRefBundler | from typing import Any, Callable, Deque, Dict, Iterable, Iterator, List, Optional, Set, Tuple, Union
from ray.data._internal.execution.interfaces import ExecutionOptions, ExecutionResources, PhysicalOperator, RefBundle, TaskContext
class _BlockRefBundler:
"""Rebundles RefBundles to get them close to a particular n... |
class _BlockRefBundler:
'''Rebundles RefBundles to get them close to a particular number of rows.'''
def __init__(self, min_rows_per_bundle: Optional[int]):
'''Creates a BlockRefBundler.
Args:
min_rows_per_bundle: The target number of rows per bundle. Note that we
b... | 9 | 6 | 12 | 0 | 8 | 4 | 2 | 0.44 | 0 | 4 | 0 | 0 | 5 | 4 | 6 | 6 | 80 | 8 | 50 | 18 | 42 | 22 | 38 | 17 | 31 | 5 | 0 | 2 | 11 |
10,071 | ray-project/ray | python/ray/data/_internal/execution/operators/map_operator.py | ray.data._internal.execution.operators.map_operator._OrderedOutputQueue | from typing import Any, Callable, Deque, Dict, Iterable, Iterator, List, Optional, Set, Tuple, Union
from collections import defaultdict, deque
from ray.data._internal.execution.interfaces import ExecutionOptions, ExecutionResources, PhysicalOperator, RefBundle, TaskContext
class _OrderedOutputQueue(_OutputQueue):
... |
class _OrderedOutputQueue(_OutputQueue):
'''An queue that returns finished tasks in submission order.'''
def __init__(self):
pass
def notify_task_output_ready(self, task_index: int, output: RefBundle):
pass
def _move_to_next_task(self):
'''Move the outut index to the next tas... | 7 | 2 | 5 | 0 | 4 | 1 | 2 | 0.19 | 1 | 3 | 0 | 0 | 6 | 3 | 6 | 30 | 39 | 7 | 27 | 11 | 20 | 5 | 27 | 11 | 20 | 3 | 5 | 2 | 10 |
10,072 | ray-project/ray | python/ray/data/_internal/execution/operators/map_operator.py | ray.data._internal.execution.operators.map_operator._OutputQueue | from ray.data._internal.execution.interfaces import ExecutionOptions, ExecutionResources, PhysicalOperator, RefBundle, TaskContext
from abc import ABC, abstractmethod
class _OutputQueue(ABC):
"""Interface for swapping between different output order modes."""
@abstractmethod
def notify_task_output_ready(se... |
class _OutputQueue(ABC):
'''Interface for swapping between different output order modes.'''
@abstractmethod
def notify_task_output_ready(self, task_index: int, output: RefBundle):
'''Called when a task's output is ready.'''
pass
def notify_task_completed(self, task_index: int):
... | 8 | 3 | 3 | 0 | 2 | 1 | 1 | 0.25 | 1 | 2 | 0 | 2 | 4 | 0 | 4 | 24 | 19 | 4 | 12 | 8 | 4 | 3 | 9 | 5 | 4 | 1 | 4 | 0 | 4 |
10,073 | ray-project/ray | python/ray/data/_internal/execution/operators/map_operator.py | ray.data._internal.execution.operators.map_operator._UnorderedOutputQueue | from ray.data._internal.execution.interfaces import ExecutionOptions, ExecutionResources, PhysicalOperator, RefBundle, TaskContext
from collections import defaultdict, deque
from typing import Any, Callable, Deque, Dict, Iterable, Iterator, List, Optional, Set, Tuple, Union
class _UnorderedOutputQueue(_OutputQueue):
... |
class _UnorderedOutputQueue(_OutputQueue):
'''An queue that does not guarantee output order of finished tasks.'''
def __init__(self):
pass
def notify_task_output_ready(self, _: int, output: RefBundle):
pass
def has_next(self) -> bool:
pass
def get_next(self) -> RefBundle... | 5 | 1 | 2 | 0 | 2 | 0 | 1 | 0.11 | 1 | 2 | 0 | 0 | 4 | 1 | 4 | 28 | 14 | 4 | 9 | 6 | 4 | 1 | 9 | 6 | 4 | 1 | 5 | 0 | 4 |
10,074 | ray-project/ray | python/ray/data/_internal/execution/operators/map_transformer.py | ray.data._internal.execution.operators.map_transformer.BatchMapTransformFn | from ray.data._internal.execution.interfaces.task_context import TaskContext
from ray.data._internal.block_batching.block_batching import batch_blocks
from ray.data._internal.output_buffer import BlockOutputBuffer, OutputBlockSizeOption
from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar, Union
fr... |
class BatchMapTransformFn(MapTransformFn):
'''A batch-to-batch MapTransformFn.'''
def __init__(self, batch_fn: MapTransformCallable[DataBatch, DataBatch], *, is_udf: bool=False, batch_size: Optional[int]=None, batch_format: Optional[BatchFormat]=None, zero_copy_batch: bool=False, output_block_size_option: Opt... | 7 | 1 | 5 | 0 | 5 | 0 | 1 | 0.05 | 1 | 6 | 3 | 0 | 4 | 1 | 4 | 10 | 26 | 4 | 21 | 10 | 12 | 1 | 10 | 6 | 5 | 1 | 1 | 0 | 4 |
10,075 | ray-project/ray | python/ray/data/_internal/execution/operators/map_transformer.py | ray.data._internal.execution.operators.map_transformer.BlockMapTransformFn | from ray.data.block import BatchFormat, Block, BlockAccessor, DataBatch
from ray.data._internal.execution.interfaces.task_context import TaskContext
from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar, Union
from ray.data._internal.output_buffer import BlockOutputBuffer, OutputBlockSizeOption
cla... |
class BlockMapTransformFn(MapTransformFn):
'''A block-to-block MapTransformFn.'''
def __init__(self, block_fn: MapTransformCallable[Block, Block], *, is_udf: bool=False, disable_block_shaping: bool=False, output_block_size_option: Optional[OutputBlockSizeOption]=None):
'''
Initializes the obje... | 6 | 2 | 4 | 0 | 4 | 0 | 1 | 0.06 | 1 | 5 | 3 | 0 | 4 | 1 | 4 | 10 | 21 | 4 | 16 | 6 | 11 | 1 | 10 | 6 | 5 | 1 | 1 | 0 | 4 |
10,076 | ray-project/ray | python/ray/data/_internal/execution/operators/map_transformer.py | ray.data._internal.execution.operators.map_transformer.MapTransformFn | from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar, Union
from ray.data.block import BatchFormat, Block, BlockAccessor, DataBatch
from ray.data._internal.execution.interfaces.task_context import TaskContext
from ray.data._internal.output_buffer import BlockOutputBuffer, OutputBlockSizeOption
from... |
class MapTransformFn(ABC):
'''Represents a single transform function in a MapTransformer.'''
def __init__(self, input_type: MapTransformFnDataType, *, is_udf: bool=False, output_block_size_option: Optional[OutputBlockSizeOption]=None):
'''
Args:
input_type: Expected type of the inp... | 18 | 2 | 6 | 0 | 5 | 1 | 1 | 0.22 | 0 | 5 | 3 | 7 | 6 | 6 | 6 | 6 | 45 | 6 | 32 | 27 | 11 | 7 | 18 | 13 | 11 | 1 | 0 | 0 | 6 |
10,077 | ray-project/ray | python/ray/data/_internal/execution/operators/map_transformer.py | ray.data._internal.execution.operators.map_transformer.MapTransformFnDataType | from enum import Enum
from ray.data.block import BatchFormat, Block, BlockAccessor, DataBatch
class MapTransformFnDataType(Enum):
"""An enum that represents the input/output data type of a MapTransformFn."""
Block = 0
Row = 1
Batch = 2 |
class MapTransformFnDataType(Enum):
'''An enum that represents the input/output data type of a MapTransformFn.'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.25 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 49 | 6 | 1 | 4 | 4 | 3 | 1 | 4 | 4 | 3 | 0 | 4 | 0 | 0 |
10,078 | ray-project/ray | python/ray/data/_internal/execution/operators/map_transformer.py | ray.data._internal.execution.operators.map_transformer.MapTransformer | from ray.data._internal.execution.interfaces.task_context import TaskContext
from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar, Union
from ray.data.block import BatchFormat, Block, BlockAccessor, DataBatch
import time
from ray.data._internal.output_buffer import BlockOutputBuffer, OutputBlockSiz... |
class MapTransformer:
'''Encapsulates the data transformation logic of a physical MapOperator.
A MapTransformer may consist of one or more steps, each of which is represented
as a MapTransformFn. The first MapTransformFn must take blocks as input, and
the last MapTransformFn must output blocks. The int... | 15 | 7 | 10 | 1 | 8 | 2 | 2 | 0.31 | 0 | 7 | 3 | 0 | 9 | 4 | 9 | 9 | 115 | 17 | 75 | 34 | 54 | 23 | 52 | 24 | 41 | 4 | 0 | 2 | 17 |
10,079 | ray-project/ray | python/ray/data/_internal/execution/operators/map_transformer.py | ray.data._internal.execution.operators.map_transformer.RowMapTransformFn | from ray.data._internal.output_buffer import BlockOutputBuffer, OutputBlockSizeOption
from ray.data.block import BatchFormat, Block, BlockAccessor, DataBatch
from typing import Any, Callable, Dict, Iterable, List, Optional, TypeVar, Union
from ray.data._internal.execution.interfaces.task_context import TaskContext
cla... |
class RowMapTransformFn(MapTransformFn):
'''A rows-to-rows MapTransformFn.'''
def __init__(self, row_fn: MapTransformCallable[Row, Row], *, is_udf: bool=False, output_block_size_option: OutputBlockSizeOption):
pass
def _pre_process(self, blocks: Iterable[Block]) -> Iterable[MapTransformFnData]:
... | 7 | 1 | 4 | 0 | 4 | 0 | 1 | 0.07 | 1 | 6 | 3 | 0 | 4 | 1 | 4 | 10 | 20 | 4 | 15 | 6 | 10 | 1 | 10 | 6 | 5 | 1 | 1 | 0 | 4 |
10,080 | ray-project/ray | python/ray/data/_internal/execution/operators/output_splitter.py | ray.data._internal.execution.operators.output_splitter.OutputSplitter | from ray.data._internal.execution.util import locality_string
import time
from typing import Any, Collection, Dict, List, Optional, Tuple
from collections import deque
from ray.data.context import DataContext
from ray.data._internal.execution.interfaces import ExecutionOptions, NodeIdStr, PhysicalOperator, RefBundle
fr... |
class OutputSplitter(InternalQueueOperatorMixin, PhysicalOperator):
'''An operator that splits the given data into `n` output splits.
The output bundles of this operator will have a `bundle.output_split_idx` attr
set to an integer from [0..n-1]. This operator tries to divide the rows evenly
across outp... | 23 | 3 | 10 | 0 | 8 | 2 | 2 | 0.29 | 1 | 9 | 1 | 0 | 21 | 9 | 21 | 21 | 240 | 34 | 161 | 63 | 132 | 46 | 139 | 56 | 117 | 5 | 1 | 4 | 41 |
10,081 | ray-project/ray | python/ray/data/_internal/execution/operators/task_pool_map_operator.py | ray.data._internal.execution.operators.task_pool_map_operator.TaskPoolMapOperator | from ray.data.context import DataContext
from ray.data._internal.execution.operators.map_operator import MapOperator, _map_task
from ray.data._internal.remote_fn import cached_remote_fn
from typing import Any, Callable, Dict, Optional, Tuple
from ray.data._internal.execution.interfaces import ExecutionResources, Physic... |
class TaskPoolMapOperator(MapOperator):
'''A MapOperator implementation that executes tasks on a task pool.'''
def __init__(self, map_transformer: MapTransformer, input_op: PhysicalOperator, data_context: DataContext, name: str='TaskPoolMap', target_max_block_size_override: Optional[int]=None, min_rows_per_bu... | 13 | 2 | 13 | 1 | 9 | 4 | 1 | 0.43 | 1 | 7 | 2 | 0 | 9 | 3 | 9 | 60 | 131 | 15 | 81 | 32 | 59 | 35 | 37 | 19 | 27 | 4 | 5 | 2 | 13 |
10,082 | ray-project/ray | python/ray/data/_internal/execution/operators/union_operator.py | ray.data._internal.execution.operators.union_operator.UnionOperator | from ray.data._internal.execution.operators.base_physical_operator import InternalQueueOperatorMixin, NAryOperator
from typing import List, Optional
import collections
from ray.data.context import DataContext
from ray.data._internal.stats import StatsDict
from ray.data._internal.execution.interfaces import ExecutionOpt... |
class UnionOperator(InternalQueueOperatorMixin, NAryOperator):
'''An operator that combines output blocks from
two or more input operators into a single output.'''
def __init__(self, data_context: DataContext, *input_ops: PhysicalOperator):
'''Create a UnionOperator.
Args:
inpu... | 12 | 2 | 9 | 1 | 7 | 2 | 2 | 0.33 | 1 | 9 | 4 | 0 | 10 | 5 | 10 | 11 | 104 | 16 | 66 | 28 | 51 | 22 | 57 | 24 | 46 | 4 | 2 | 2 | 21 |
10,083 | ray-project/ray | python/ray/data/_internal/execution/operators/zip_operator.py | ray.data._internal.execution.operators.zip_operator.ZipOperator | import ray
from ray.data._internal.remote_fn import cached_remote_fn
from ray.data._internal.split import _split_at_indices
from ray.data._internal.execution.interfaces import PhysicalOperator, RefBundle
from ray.data.context import DataContext
import itertools
from ray.data.block import Block, BlockAccessor, BlockExec... |
class ZipOperator(InternalQueueOperatorMixin, PhysicalOperator):
'''An operator that zips its inputs together.
NOTE: the implementation is bulk for now, which materializes all its inputs in
object store, before starting execution. Should re-implement it as a streaming
operator in the future.
'''
... | 13 | 4 | 20 | 2 | 14 | 4 | 3 | 0.33 | 1 | 8 | 2 | 0 | 10 | 4 | 10 | 60 | 218 | 27 | 144 | 56 | 123 | 47 | 96 | 46 | 85 | 11 | 2 | 2 | 27 |
10,084 | ray-project/ray | python/ray/data/_internal/execution/resource_manager.py | ray.data._internal.execution.resource_manager.OpResourceAllocator | from ray.data._internal.execution.interfaces.physical_operator import PhysicalOperator, ReportsExtraResourceUsage
from ray.data._internal.execution.interfaces.execution_options import ExecutionOptions, ExecutionResources
from abc import ABC, abstractmethod
from typing import TYPE_CHECKING, Callable, Dict, Iterable, Lis... |
class OpResourceAllocator(ABC):
'''An interface for dynamic operator resource allocation.
This interface allows dynamically allocating available resources to each operator,
limiting how many tasks each operator can submit, and how much data each operator
can read from its running tasks.
'''
de... | 8 | 4 | 3 | 0 | 2 | 1 | 1 | 0.67 | 1 | 3 | 1 | 1 | 5 | 1 | 5 | 25 | 31 | 6 | 15 | 11 | 5 | 10 | 11 | 7 | 5 | 1 | 4 | 0 | 5 |
10,085 | ray-project/ray | python/ray/data/_internal/execution/resource_manager.py | ray.data._internal.execution.resource_manager.ReservationOpResourceAllocator | from ray.util.debug import log_once
from ray.data._internal.execution.interfaces.execution_options import ExecutionOptions, ExecutionResources
from typing import TYPE_CHECKING, Callable, Dict, Iterable, List, Optional
from collections import defaultdict
import math
import time
from ray.data._internal.execution.interfac... |
class ReservationOpResourceAllocator(OpResourceAllocator):
'''An OpResourceAllocator implementation that reserves resources for each operator.
This class reserves memory and CPU resources for eligible operators, and considers
runtime resource usages to limit the resources that each operator can use.
It... | 18 | 8 | 20 | 1 | 13 | 6 | 2 | 0.57 | 1 | 8 | 2 | 0 | 12 | 9 | 12 | 37 | 356 | 35 | 205 | 71 | 179 | 116 | 143 | 62 | 126 | 6 | 5 | 2 | 37 |
10,086 | ray-project/ray | python/ray/data/_internal/execution/resource_manager.py | ray.data._internal.execution.resource_manager.ResourceManager | from ray.data._internal.execution.operators.input_data_buffer import InputDataBuffer
from ray._private.ray_constants import env_float
from ray.data._internal.execution.interfaces.execution_options import ExecutionOptions, ExecutionResources
from ray.data._internal.util import GiB
from ray.util.debug import log_once
fro... |
class ResourceManager:
'''A class that manages the resource usage of a streaming executor.'''
def __init__(self, topology: 'Topology', options: ExecutionOptions, get_total_resources: Callable[[], ExecutionResources], data_context: DataContext):
pass
def _warn_about_object_store_memory_if_needed(s... | 16 | 13 | 16 | 1 | 11 | 3 | 2 | 0.32 | 0 | 8 | 3 | 0 | 13 | 18 | 13 | 13 | 236 | 32 | 154 | 59 | 133 | 50 | 113 | 52 | 99 | 5 | 0 | 2 | 25 |
10,087 | ray-project/ray | python/ray/data/_internal/execution/streaming_executor.py | ray.data._internal.execution.streaming_executor.StreamingExecutor | from ray.data._internal.progress_bar import ProgressBar
from ray.data._internal.execution.dataset_state import DatasetState
from ray.data._internal.execution.streaming_executor_state import OpState, Topology, build_streaming_topology, process_completed_tasks, select_operator_to_run, update_operator_states
from ray.data... |
class StreamingExecutor(Executor, threading.Thread):
'''A streaming Dataset executor.
This implementation executes Dataset DAGs in a fully streamed way. It runs
by setting up the operator topology, and then routing blocks through operators in
a way that maximizes throughput under resource constraints.
... | 19 | 8 | 22 | 2 | 17 | 4 | 3 | 0.25 | 2 | 14 | 8 | 0 | 14 | 19 | 14 | 39 | 382 | 46 | 268 | 70 | 246 | 68 | 179 | 66 | 159 | 10 | 1 | 3 | 55 |
10,088 | ray-project/ray | python/ray/data/_internal/execution/streaming_executor_state.py | ray.data._internal.execution.streaming_executor_state.OpBufferQueue | from collections import defaultdict
from ray.data._internal.execution.bundle_queue import create_bundle_queue
from ray.data._internal.execution.interfaces import ExecutionOptions, PhysicalOperator, RefBundle
from typing import TYPE_CHECKING, Dict, List, Optional, Tuple
import threading
class OpBufferQueue:
"""A FI... |
class OpBufferQueue:
'''A FIFO queue to buffer RefBundles between upstream and downstream operators.
This class is thread-safe.
'''
def __init__(self):
pass
@property
def memory_usage(self) -> int:
'''The total memory usage of the queue in bytes.'''
pass
@proper... | 12 | 7 | 11 | 0 | 8 | 3 | 2 | 0.42 | 0 | 4 | 0 | 0 | 8 | 5 | 8 | 8 | 104 | 9 | 67 | 19 | 56 | 28 | 60 | 17 | 51 | 8 | 0 | 4 | 17 |
10,089 | ray-project/ray | python/ray/data/_internal/execution/streaming_executor_state.py | ray.data._internal.execution.streaming_executor_state.OpSchedulingStatus | from dataclasses import dataclass
@dataclass
class OpSchedulingStatus:
"""The scheduling status of an operator.
This will be updated each time when StreamingExecutor makes
a scheduling decision, i.e., in each `select_operator_to_run`
call.
"""
runnable: bool = False
under_resource_limits: ... | @dataclass
class OpSchedulingStatus:
'''The scheduling status of an operator.
This will be updated each time when StreamingExecutor makes
a scheduling decision, i.e., in each `select_operator_to_run`
call.
'''
pass | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 2.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 17 | 2 | 4 | 4 | 3 | 11 | 4 | 4 | 3 | 0 | 0 | 0 | 0 |
10,090 | ray-project/ray | python/ray/data/_internal/execution/streaming_executor_state.py | ray.data._internal.execution.streaming_executor_state.OpState | from typing import TYPE_CHECKING, Dict, List, Optional, Tuple
import time
from ray.data.context import DataContext
from ray.data._internal.execution.operators.hash_shuffle import HashShuffleProgressBarMixin
from ray.data._internal.execution.operators.base_physical_operator import AllToAllOperator, InternalQueueOperator... |
class OpState:
'''The execution state tracked for each PhysicalOperator.
This tracks state to manage input and output buffering for StreamingExecutor and
progress bars, which is separate from execution state internal to the operators.
Note: we use the `deque` data structure here because it is thread-sa... | 17 | 14 | 10 | 0 | 7 | 3 | 2 | 0.44 | 0 | 13 | 6 | 0 | 15 | 10 | 15 | 15 | 172 | 24 | 103 | 39 | 87 | 45 | 86 | 39 | 70 | 5 | 0 | 2 | 32 |
10,091 | ray-project/ray | python/ray/data/_internal/iterator/iterator_impl.py | ray.data._internal.iterator.iterator_impl.DataIteratorImpl | from typing import TYPE_CHECKING, Iterator, Optional, Tuple, Union
from ray.data.iterator import DataIterator
from ray.data._internal.execution.interfaces.ref_bundle import RefBundle
from ray.data.context import DataContext
from ray.data._internal.stats import DatasetStats
class DataIteratorImpl(DataIterator):
de... |
class DataIteratorImpl(DataIterator):
def __init__(self, base_dataset: 'Dataset'):
pass
def __repr__(self) -> str:
pass
def _to_ref_bundle_iterator(self) -> Tuple[Iterator[RefBundle], Optional[DatasetStats], bool]:
pass
def stats(self) -> str:
pass
def schema(se... | 8 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 1 | 5 | 2 | 0 | 6 | 1 | 6 | 6 | 28 | 5 | 23 | 15 | 11 | 0 | 16 | 10 | 9 | 1 | 1 | 0 | 6 |
10,092 | ray-project/ray | python/ray/data/_internal/iterator/stream_split_iterator.py | ray.data._internal.iterator.stream_split_iterator.SplitCoordinator | from dataclasses import replace
import ray
import threading
from ray.data._internal.execution.legacy_compat import execute_to_legacy_bundle_iterator
from ray.data._internal.execution.interfaces import NodeIdStr, RefBundle
from ray.util.debug import log_once
from ray.data._internal.stats import DatasetStats
from typing ... | @ray.remote(num_cpus=0)
class SplitCoordinator:
'''Coordinator actor for routing blocks to output splits.
This actor runs a streaming executor locally on its main thread. Clients can
retrieve results via actor calls running on other threads.
'''
def __init__(self, dataset_wrapper: _DatasetWrapper, ... | 8 | 5 | 27 | 3 | 21 | 3 | 3 | 0.22 | 0 | 11 | 5 | 0 | 5 | 13 | 5 | 5 | 168 | 25 | 117 | 39 | 101 | 26 | 79 | 30 | 71 | 7 | 0 | 3 | 22 |
10,093 | ray-project/ray | python/ray/data/_internal/iterator/stream_split_iterator.py | ray.data._internal.iterator.stream_split_iterator.StreamSplitDataIterator | from ray.data._internal.stats import DatasetStats
import ray
from ray.util.scheduling_strategies import NodeAffinitySchedulingStrategy
from ray.data.context import DataContext
from ray.data.iterator import DataIterator
from ray.types import ObjectRef
from typing import TYPE_CHECKING, Dict, Iterator, List, Optional, Tup... |
class StreamSplitDataIterator(DataIterator):
'''Implements a collection of iterators over a shared data stream.'''
@staticmethod
def create(base_dataset: 'Dataset', n: int, locality_hints: Optional[List[NodeIdStr]]) -> List['StreamSplitDataIterator']:
'''Create a split iterator from the given base ... | 11 | 5 | 12 | 0 | 11 | 1 | 1 | 0.14 | 1 | 10 | 5 | 0 | 6 | 5 | 7 | 7 | 89 | 10 | 69 | 34 | 46 | 10 | 33 | 20 | 24 | 3 | 1 | 2 | 10 |
10,094 | ray-project/ray | python/ray/data/_internal/logging.py | ray.data._internal.logging.HiddenRecordFilter | class HiddenRecordFilter:
"""Filters out log records with the "hide" attribute set to True.
This filter allows you to override default logging behavior. For example, if errors
are printed by default, and you don't want to print a specific error, you can set
the "hide" attribute to avoid printing the me... | class HiddenRecordFilter:
'''Filters out log records with the "hide" attribute set to True.
This filter allows you to override default logging behavior. For example, if errors
are printed by default, and you don't want to print a specific error, you can set
the "hide" attribute to avoid printing the mes... | 2 | 1 | 2 | 0 | 2 | 0 | 1 | 3.33 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 18 | 5 | 3 | 2 | 1 | 10 | 3 | 2 | 1 | 1 | 0 | 0 | 1 |
10,095 | ray-project/ray | python/ray/data/_internal/logging.py | ray.data._internal.logging.SessionFileHandler | import logging
import os
import logging.config
class SessionFileHandler(logging.Handler):
"""A handler that writes to a log file in the Ray session directory.
The Ray session directory isn't available until Ray is initialized, so this handler
lazily creates the file handler when you emit a log record.
... |
class SessionFileHandler(logging.Handler):
'''A handler that writes to a log file in the Ray session directory.
The Ray session directory isn't available until Ray is initialized, so this handler
lazily creates the file handler when you emit a log record.
Args:
filename: The name of the log fil... | 5 | 1 | 7 | 1 | 6 | 0 | 2 | 0.27 | 1 | 4 | 0 | 0 | 4 | 4 | 4 | 24 | 42 | 9 | 26 | 10 | 21 | 7 | 26 | 10 | 21 | 3 | 3 | 1 | 9 |
10,096 | ray-project/ray | python/ray/data/_internal/logical/interfaces/logical_operator.py | ray.data._internal.logical.interfaces.logical_operator.LogicalOperator | from typing import TYPE_CHECKING, Any, Callable, Dict, Iterator, List, Optional
from .operator import Operator
from ray.data.block import BlockMetadata
class LogicalOperator(Operator):
"""Abstract class for logical operators.
A logical operator describes transformation, and later is converted into
physica... |
class LogicalOperator(Operator):
'''Abstract class for logical operators.
A logical operator describes transformation, and later is converted into
physical operator.
'''
def __init__(self, name: str, input_dependencies: List['LogicalOperator'], num_outputs: Optional[int]=None):
pass
d... | 13 | 6 | 7 | 0 | 4 | 3 | 1 | 0.76 | 1 | 4 | 0 | 6 | 8 | 1 | 8 | 15 | 70 | 13 | 34 | 18 | 18 | 26 | 23 | 11 | 14 | 3 | 1 | 1 | 11 |
10,097 | ray-project/ray | python/ray/data/_internal/logical/interfaces/logical_plan.py | ray.data._internal.logical.interfaces.logical_plan.LogicalPlan | from .plan import Plan
from typing import TYPE_CHECKING, List
from .logical_operator import LogicalOperator
class LogicalPlan(Plan):
"""The plan with a DAG of logical operators."""
def __init__(self, dag: LogicalOperator, context: 'DataContext'):
super().__init__(context)
self._dag = dag
... |
class LogicalPlan(Plan):
'''The plan with a DAG of logical operators.'''
def __init__(self, dag: LogicalOperator, context: 'DataContext'):
pass
@property
def dag(self) -> LogicalOperator:
'''Get the DAG of logical operators.'''
pass
def sources(self) -> List[LogicalOperato... | 5 | 3 | 5 | 0 | 4 | 1 | 2 | 0.29 | 1 | 2 | 1 | 0 | 3 | 1 | 3 | 6 | 22 | 4 | 14 | 8 | 9 | 4 | 13 | 7 | 9 | 3 | 1 | 1 | 5 |
10,098 | ray-project/ray | python/ray/data/_internal/logical/interfaces/operator.py | ray.data._internal.logical.interfaces.operator.Operator | from typing import Callable, Iterator, List
import copy
class Operator:
"""Abstract class for operators.
Operators live on the driver side of the Dataset only.
"""
def __init__(self, name: str, input_dependencies: List['Operator']):
self._name = name
self._input_dependencies = input_d... |
class Operator:
'''Abstract class for operators.
Operators live on the driver side of the Dataset only.
'''
def __init__(self, name: str, input_dependencies: List['Operator']):
pass
@property
def name(self) -> str:
pass
@property
def dag_str(self) -> str:
'''Str... | 15 | 6 | 6 | 0 | 5 | 0 | 1 | 0.15 | 0 | 1 | 0 | 2 | 7 | 3 | 7 | 7 | 55 | 8 | 41 | 21 | 26 | 6 | 29 | 14 | 21 | 2 | 0 | 1 | 10 |
10,099 | ray-project/ray | python/ray/data/_internal/logical/interfaces/optimizer.py | ray.data._internal.logical.interfaces.optimizer.Optimizer | from .plan import Plan
from typing import List, Type
class Optimizer:
"""Abstract class for optimizers.
An optimizers transforms a DAG of operators with a list of predefined rules.
"""
@property
def rules(self) -> List[Rule]:
"""List of predefined rules for this optimizer."""
rais... |
class Optimizer:
'''Abstract class for optimizers.
An optimizers transforms a DAG of operators with a list of predefined rules.
'''
@property
def rules(self) -> List[Rule]:
'''List of predefined rules for this optimizer.'''
pass
def optimize(self, plan: Plan) -> Plan:
... | 4 | 3 | 4 | 0 | 3 | 1 | 2 | 0.63 | 0 | 3 | 2 | 2 | 2 | 0 | 2 | 2 | 16 | 3 | 8 | 5 | 4 | 5 | 7 | 4 | 4 | 2 | 0 | 1 | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.