(children, schema=None, **kwargs)
| 490 | |
| 491 | |
| 492 | def _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 | |
| 517 | def parquet_dataset(metadata_path, schema=None, filesystem=None, format=None, |
no test coverage detected