Skip to content

Pandas compat - #7712

Merged
jrbourbeau merged 10 commits into
dask:mainfrom
jsignell:pandas-compat
May 27, 2021
Merged

jrbourbeau merged 10 commits into
dask:mainfrom
jsignell:pandas-compat

Conversation

@jsignell

Copy link
Copy Markdown
Member

Addressing some of #7100 and #7710

@github-actions github-actions Bot added the array label May 27, 2021
Comment thread dask/base.py
offset = (
x.ctypes.get_as_parameter().value
- x.base.ctypes.get_as_parameter().value
x.ctypes._as_parameter_.value - x.base.ctypes._as_parameter_.value

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Initially I was concerned to see us using a private _as_parameter_ attribute, however after looking a little closer this is what NumPy recommends so this seems okay. Just posting a quick comment here in case other had a similar thought

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yeah I had the same reaction, but the warning specifically recommended using the private attribute 🤷

@jsignell
jsignell marked this pull request as ready for review May 27, 2021 15:27
@jsignell

Copy link
Copy Markdown
Member Author

Woohoo! The upstream tests are passing and it looks like the failing test is just a flaky one. Good with you if I merge @jrbourbeau?

@jrbourbeau jrbourbeau left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks as always for handling this @jsignell! Overall this looks good, just left a couple of small comments

Comment thread dask/dataframe/tests/test_groupby.py Resolved
Comment on lines +1155 to +1157
@pytest.mark.filterwarnings(
"ignore:Dropping of nuisance columns:FutureWarning"
) # https://github.com/dask/dask/issues/7714

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just to confirm, we can remove this warning filter once we've implemented numeric_only= as mentioned over in #7714?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah exactly. So filter the warning for now, and hopefully implement soon. Following the pattern in #7100

{
"A": np.random.choice([1, 2, np.nan], 100),
"B": np.random.choice(["a", "b", np.nan], 100),
"B": np.random.choice(["a", "b", "nan"], 100),

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This promotion was happening silently before, but numpy doesn't tolerate that anymore.

_numpy_117 = LooseVersion(np.__version__) >= "1.17.0"
_numpy_118 = LooseVersion(np.__version__) >= "1.18.0"
_numpy_120 = LooseVersion(np.__version__) >= "1.20.0"
_numpy_121 = LooseVersion(np.__version__) >= "1.21.0"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is only used in a comment so far, but it really helps to have it for greppability

@jsignell

Copy link
Copy Markdown
Member Author

Thanks for the review @jrbourbeau! Good to merge?

@jrbourbeau jrbourbeau left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yep, thanks again

@jrbourbeau
jrbourbeau merged commit 636b0d6 into dask:main May 27, 2021
@jsignell
jsignell deleted the pandas-compat branch May 27, 2021 17:11
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