Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python bool meta always numpy.bool_ #10677

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion dask/dataframe/_dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from datetime import date, time
from decimal import Decimal

import numpy as np
import pandas as pd

from dask.dataframe._compat import PANDAS_GE_150
Expand Down Expand Up @@ -71,4 +72,4 @@ def _(dtype):

@make_scalar.register(bool)
def _(x):
return True
return np.bool_(True)
6 changes: 6 additions & 0 deletions dask/dataframe/tests/test_utils_dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@ def __next__(self):
meta = make_meta(1.0, parent_meta=df)
assert isinstance(meta, np.float64)

meta = make_meta(True)
assert isinstance(meta, np.bool_)

meta = make_meta(1)
assert isinstance(meta, np.int64)
Copy link
Member Author

Choose a reason for hiding this comment

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

this is failing in ci. it works on my machine... I'll have to dig in a little


# Timestamp
x = pd.Timestamp(2000, 1, 1)
meta = make_meta(x, parent_meta=df)
Expand Down