Skip to content

[Python] Fix deprecation warnings for RankOptions null_placement in our own tests #51300

Closed

Description

@jorisvandenbossche

In the test logs on CI, I see:

opt/conda/envs/arrow/lib/python3.14/site-packages/pyarrow/tests/test_compute.py::test_option_class_equality
  /opt/conda/envs/arrow/lib/python3.14/site-packages/pyarrow/tests/test_compute.py:175: FutureWarning: Specifying null_placement in RankOptions is deprecated as of 25.0.0. Specify null_placement per sort_key instead.
    pc.RankOptions(sort_keys="ascending",

opt/conda/envs/arrow/lib/python3.14/site-packages/pyarrow/tests/test_compute.py::test_option_class_equality
  /opt/conda/envs/arrow/lib/python3.14/site-packages/pyarrow/tests/test_compute.py:177: FutureWarning: Specifying null_placement in RankOptions is deprecated as of 25.0.0. Specify null_placement per sort_key instead.
    pc.RankQuantileOptions(sort_keys="ascending",

opt/conda/envs/arrow/lib/python3.14/site-packages/pyarrow/tests/test_compute.py::test_rank_options_tiebreaker[min-expected_values0]
opt/conda/envs/arrow/lib/python3.14/site-packages/pyarrow/tests/test_compute.py::test_rank_options_tiebreaker[max-expected_values1]
opt/conda/envs/arrow/lib/python3.14/site-packages/pyarrow/tests/test_compute.py::test_rank_options_tiebreaker[first-expected_values2]
opt/conda/envs/arrow/lib/python3.14/site-packages/pyarrow/tests/test_compute.py::test_rank_options_tiebreaker[dense-expected_values3]
  /opt/conda/envs/arrow/lib/python3.14/site-packages/pyarrow/tests/test_compute.py:3885: FutureWarning: Specifying null_placement in RankOptions is deprecated as of 25.0.0. Specify null_placement per sort_key instead.
    rank_options = pc.RankOptions(sort_keys="ascending",

opt/conda/envs/arrow/lib/python3.14/site-packages/pyarrow/tests/test_compute.py::test_rank_options
opt/conda/envs/arrow/lib/python3.14/site-packages/pyarrow/tests/test_compute.py::test_rank_quantile_options
opt/conda/envs/arrow/lib/python3.14/site-packages/pyarrow/tests/test_compute.py::test_rank_normal_options
  /opt/conda/envs/arrow/lib/python3.14/site-packages/pyarrow/compute.py:230: FutureWarning: Specifying null_placement in RankOptions is deprecated as of 25.0.0. Specify null_placement per sort_key instead.
    return options_class(*args, **kwargs)

opt/conda/envs/arrow/lib/python3.14/site-packages/pyarrow/tests/test_compute.py::test_rank_options
  /opt/conda/envs/arrow/lib/python3.14/site-packages/pyarrow/tests/test_compute.py:3921: FutureWarning: Specifying null_placement in RankOptions is deprecated as of 25.0.0. Specify null_placement per sort_key instead.
    pc.RankOptions(sort_keys="descending",

opt/conda/envs/arrow/lib/python3.14/site-packages/pyarrow/tests/test_compute.py::test_rank_normal_options
  /opt/conda/envs/arrow/lib/python3.14/site-packages/pyarrow/tests/test_compute.py:3975: FutureWarning: Specifying null_placement in RankOptions is deprecated as of 25.0.0. Specify null_placement per sort_key instead.
    options=pc.RankQuantileOptions(null_placement="at_start",

Those warnings should not appear in our own tests (either update the tests to use the new pattern, or explicitly assert that the warning is happening)

Activity

  1. jorisvandenbossche commented on Sep 11, 2026

    @jorisvandenbossche
    MemberAuthor

    Caused by #46926 cc @taepper

  2. taepper commented on Sep 11, 2026

    @taepper
    Contributor

    I see. Yes, this is unfortunate. We can remove the tests using the deprecated interface to avoid this warning. I left them in the PR because I thought it is still good to have test coverage for deprecated functionality.

  3. jorisvandenbossche commented on Sep 11, 2026

    @jorisvandenbossche
    MemberAuthor

    If what is being tested in those tests is covered by new tests (using the new interface), but we want to keep them to ensure this deprecated path is still working (which is indeed a good idea), then we can just suppress the warnings with a @pytest.mark.filterwarnings("ignore:...")

  4. taepper commented on Sep 11, 2026

    @taepper
    Contributor

    Great, thanks. I am not an expert in python and only adapted the interfaces when changing the underlying c++ interfaces.

  5. taepper commented on Sep 11, 2026

    @taepper
    Contributor

    take

  6. added a commit that references this issue on Sep 22, 2026
  7. added this to the 26.0.0 milestone on Sep 25, 2026
  8. AlenkaF commented on Sep 25, 2026

    @AlenkaF
    Member

    Issue resolved by pull request 51307
    #51307

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions