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

refactor: Mark schema arg in read/scan_parquet as unstable #19018

Merged
merged 2 commits into from
Sep 30, 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
16 changes: 16 additions & 0 deletions py-polars/polars/io/parquet/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ def read_parquet(
Specify the datatypes of the columns. The datatypes must match the
datatypes in the file(s). If there are extra columns that are not in the
file(s), consider also enabling `allow_missing_columns`.

.. warning::
This functionality is considered **unstable**. It may be changed
at any point without it being considered a breaking change.
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.
Expand Down Expand Up @@ -165,6 +169,10 @@ def read_parquet(
scan_parquet
scan_pyarrow_dataset
"""
if schema is not None:
msg = "The `schema` parameter of `read_parquet` is considered unstable."
issue_unstable_warning(msg)

if hive_schema is not None:
msg = "The `hive_schema` parameter of `read_parquet` is considered unstable."
issue_unstable_warning(msg)
Expand Down Expand Up @@ -384,6 +392,10 @@ def scan_parquet(
Specify the datatypes of the columns. The datatypes must match the
datatypes in the file(s). If there are extra columns that are not in the
file(s), consider also enabling `allow_missing_columns`.

.. warning::
This functionality is considered **unstable**. It may be changed
at any point without it being considered a breaking change.
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.
Expand Down Expand Up @@ -447,6 +459,10 @@ def scan_parquet(
... }
>>> pl.scan_parquet(source, storage_options=storage_options) # doctest: +SKIP
"""
if schema is not None:
msg = "The `schema` parameter of `scan_parquet` is considered unstable."
issue_unstable_warning(msg)

if hive_schema is not None:
msg = "The `hive_schema` parameter of `scan_parquet` is considered unstable."
issue_unstable_warning(msg)
Expand Down