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 all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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)
8 changes: 7 additions & 1 deletion dask/dataframe/tests/test_utils_dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,13 @@ def __next__(self):

# Python scalar
meta = make_meta(1.0, parent_meta=df)
assert isinstance(meta, np.float64)
assert meta.dtype.kind == "i"

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

meta = make_meta(1)
assert isinstance(meta, np.intp), type(meta)

# Timestamp
x = pd.Timestamp(2000, 1, 1)
Expand Down
Loading