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

Function _ensure_partitioning

python/pyarrow/dataset.py:277–294  ·  view source on GitHub ↗

Validate input and return a Partitioning(Factory). It passes None through if no partitioning scheme is defined.

(scheme)

Source from the content-addressed store, hash-verified

275
276
277def _ensure_partitioning(scheme):
278 """
279 Validate input and return a Partitioning(Factory).
280
281 It passes None through if no partitioning scheme is defined.
282 """
283 if scheme is None:
284 pass
285 elif isinstance(scheme, str):
286 scheme = partitioning(flavor=scheme)
287 elif isinstance(scheme, list):
288 scheme = partitioning(field_names=scheme)
289 elif isinstance(scheme, (Partitioning, PartitioningFactory)):
290 pass
291 else:
292 raise ValueError(
293 f"Expected Partitioning or PartitioningFactory, got {type(scheme)}")
294 return scheme
295
296
297def _ensure_format(obj):

Callers 2

_filesystem_datasetFunction · 0.85
parquet_datasetFunction · 0.85

Calls 2

partitioningFunction · 0.85
typeEnum · 0.50

Tested by

no test coverage detected