From 58155f0d38ba4b8b64a2e4224de93afff355b7be Mon Sep 17 00:00:00 2001 From: Marco Gorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Tue, 9 Jul 2024 18:01:06 +0100 Subject: [PATCH] fixup deprecated directive --- py-polars/polars/dataframe/frame.py | 6 +++--- py-polars/polars/lazyframe/frame.py | 2 +- py-polars/tests/unit/functions/test_business_day_count.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/py-polars/polars/dataframe/frame.py b/py-polars/polars/dataframe/frame.py index 06a8068a06e6..43450fc6e753 100644 --- a/py-polars/polars/dataframe/frame.py +++ b/py-polars/polars/dataframe/frame.py @@ -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): @@ -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 @@ -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 diff --git a/py-polars/polars/lazyframe/frame.py b/py-polars/polars/lazyframe/frame.py index 8f905bc111c1..2935f9091057 100644 --- a/py-polars/polars/lazyframe/frame.py +++ b/py-polars/polars/lazyframe/frame.py @@ -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 diff --git a/py-polars/tests/unit/functions/test_business_day_count.py b/py-polars/tests/unit/functions/test_business_day_count.py index b6ade7b6e8e5..410293da722b 100644 --- a/py-polars/tests/unit/functions/test_business_day_count.py +++ b/py-polars/tests/unit/functions/test_business_day_count.py @@ -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