MCPcopy Create free account
hub / github.com/apache/arrow / _union_dataset

Function _union_dataset

python/pyarrow/dataset.py:492–514  ·  view source on GitHub ↗
(children, schema=None, **kwargs)

Source from the content-addressed store, hash-verified

490
491
492def _union_dataset(children, schema=None, **kwargs):
493 if any(v is not None for v in kwargs.values()):
494 raise ValueError(
495 "When passing a list of Datasets, you cannot pass any additional "
496 "arguments"
497 )
498
499 if schema is None:
500 # unify the children datasets' schemas
501 schema = pa.unify_schemas([child.schema for child in children])
502
503 for child in children:
504 if getattr(child, "_scan_options", None):
505 raise ValueError(
506 "Creating an UnionDataset from filtered or projected Datasets "
507 "is currently not supported. Union the unfiltered datasets "
508 "and apply the filter to the resulting union."
509 )
510
511 # create datasets with the requested schema
512 children = [child.replace_schema(schema) for child in children]
513
514 return UnionDataset(schema, children)
515
516
517def parquet_dataset(metadata_path, schema=None, filesystem=None, format=None,

Callers 1

datasetFunction · 0.85

Calls 2

UnionDatasetFunction · 0.50
valuesMethod · 0.45

Tested by

no test coverage detected