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

docs(python): Fixup "deprecated" directive for DataFrame.melt and LazyFrame.melt #17530

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions py-polars/polars/dataframe/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -2199,7 +2199,7 @@ def to_pandas(
dtype: object
"""
if use_pyarrow_extension_array:
if parse_version(pd.__version__) < parse_version("1.5"):
if parse_version(pd.__version__) < (1, 5):
msg = f'pandas>=1.5.0 is required for `to_pandas("use_pyarrow_extension_array=True")`, found Pandas {pd.__version__!r}'
raise ModuleUpgradeRequiredError(msg)
if not _PYARROW_AVAILABLE or parse_version(pa.__version__) < (8, 0):
Expand Down Expand Up @@ -3874,7 +3874,7 @@ def unpack_table_name(name: str) -> tuple[str | None, str | None, str]:

import_optional(
module_name="sqlalchemy",
min_version=("2.0" if pd_version >= parse_version("2.2") else "1.4"),
min_version=("2.0" if pd_version >= (2, 2) else "1.4"),
min_err_prefix="pandas >= 2.2 requires",
)
# note: the catalog (database) should be a part of the connection string
Expand Down Expand Up @@ -10896,7 +10896,7 @@ def melt(
measured variables (value_vars), are "unpivoted" to the row axis leaving just
two non-identifier columns, 'variable' and 'value'.

.. deprecated 1.0.0
.. deprecated:: 1.0.0
Please use :meth:`.unpivot` instead.

Parameters
Expand Down
2 changes: 1 addition & 1 deletion py-polars/polars/lazyframe/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -6455,7 +6455,7 @@ def melt(
measured variables (value_vars), are "unpivoted" to the row axis leaving just
two non-identifier columns, 'variable' and 'value'.

.. deprecated 1.0.0
.. deprecated:: 1.0.0
Please use :meth:`.unpivot` instead.

Parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def test_against_np_busday_count(
.item()
)
expected = np.busday_count(start, end, weekmask=week_mask, holidays=holidays)
if start > end and parse_version(np.__version__) < parse_version("1.25"):
if start > end and parse_version(np.__version__) < (1, 25):
# Bug in old versions of numpy
reject()
assert result == expected
Loading