Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(python): Add unstable warning to hive_schema functionality #15508

Merged
merged 1 commit into from
Apr 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions py-polars/polars/io/parquet/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import polars._reexport as pl
from polars._utils.deprecation import deprecate_renamed_parameter
from polars._utils.unstable import issue_unstable_warning
from polars._utils.various import is_int_sequence, normalize_filepath
from polars.convert import from_arrow
from polars.dependencies import _PYARROW_AVAILABLE
Expand Down Expand Up @@ -75,6 +76,10 @@ def read_parquet(
hive_schema
The column names and data types of the columns by which the data is partitioned.
If set to `None` (default), the schema of the Hive partitions is inferred.

.. warning::
This functionality is considered **unstable**. It may be changed
at any point without it being considered a breaking change.
rechunk
Make sure that all columns are contiguous in memory by
aggregating the chunks into a single array.
Expand Down Expand Up @@ -123,6 +128,10 @@ def read_parquet(
benchmarking the parquet-reader as `rechunk` can be an expensive operation
that should not contribute to the timings.
"""
if hive_schema is not None:
msg = "The `hive_schema` parameter of `read_parquet` is considered unstable."
issue_unstable_warning(msg)

# Dispatch to pyarrow if requested
if use_pyarrow:
if not _PYARROW_AVAILABLE:
Expand Down Expand Up @@ -269,6 +278,10 @@ def scan_parquet(
hive_schema
The column names and data types of the columns by which the data is partitioned.
If set to `None` (default), the schema of the Hive partitions is inferred.

.. warning::
This functionality is considered **unstable**. It may be changed
at any point without it being considered a breaking change.
rechunk
In case of reading multiple files via a glob pattern rechunk the final DataFrame
into contiguous memory chunks.
Expand Down Expand Up @@ -315,6 +328,10 @@ def scan_parquet(
... }
>>> pl.scan_parquet(source, storage_options=storage_options) # doctest: +SKIP
"""
if hive_schema is not None:
msg = "The `hive_schema` parameter of `scan_parquet` is considered unstable."
issue_unstable_warning(msg)

if isinstance(source, (str, Path)):
source = normalize_filepath(source)
else:
Expand Down
Loading