Skip to content

Avoid pandas Series.__getitem__ deprecation in tests#10308

Merged
jrbourbeau merged 3 commits intodask:mainfrom
jrbourbeau:series-getitem-depr
May 23, 2023
Merged

Avoid pandas Series.__getitem__ deprecation in tests#10308
jrbourbeau merged 3 commits intodask:mainfrom
jrbourbeau:series-getitem-depr

Conversation

@jrbourbeau
Copy link
Copy Markdown
Member

We're seeing

FAILED dask/dataframe/tests/test_dataframe.py::test_index_is_monotonic_dt64 - FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
FAILED dask/dataframe/io/tests/test_hdf.py::test_to_hdf_lock_delays - FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
FAILED dask/dataframe/tests/test_dataframe.py::test_apply - FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`

in our upstream build due to pandas-dev/pandas#53201 (e.g. see this CI build)

This PR moves to iloc based selections to avoid the deprecation without changing the intent of any tests

cc @phofl

Copy link
Copy Markdown
Collaborator

@phofl phofl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm, thx

@jrbourbeau jrbourbeau merged commit 260e633 into dask:main May 23, 2023
@jrbourbeau jrbourbeau deleted the series-getitem-depr branch May 23, 2023 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants