Skip to content

[Python] Fix DeprecationWarnings in PyArrow tests #49255

Description

@AlenkaF

Describe the enhancement requested

I have stumbled upon this deprecation warning in test_pandas.py:

pyarrow/tests/test_pandas.py::TestConvertMisc::test_category
  /Users/alenkafrim/Repos/arrow/python/pyarrow/tests/test_pandas.py:3078: Pandas4Warning: Constructing a Categorical with a dtype and values containing non-null entries not in that dtype's categories is deprecated and will raise in a future version.
    'cat_strings_with_na': pd.Categorical(v1 * repeats,

pyarrow/tests/test_pandas.py::TestConvertMisc::test_category_implicit_from_pandas
  /Users/alenkafrim/Repos/arrow/python/pyarrow/tests/test_pandas.py:3104: Pandas4Warning: Constructing a Categorical with a dtype and values containing non-null entries not in that dtype's categories is deprecated and will raise in a future version.
    pd.Categorical(['a', 'b', 'c'], categories=['a', 'b']),

pyarrow/tests/test_pandas.py::TestConvertMisc::test_category_implicit_from_pandas
  /Users/alenkafrim/Repos/arrow/python/pyarrow/tests/test_pandas.py:3105: Pandas4Warning: Constructing a Categorical with a dtype and values containing non-null entries not in that dtype's categories is deprecated and will raise in a future version.
    pd.Categorical(['a', 'b', 'c'], categories=['a', 'b'],

There might be more we should address.

Component(s)

Python

Activity

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