Skip to content

BUG: is_scalar(Enum) gives False #62063

@cmp0xff

Description

@cmp0xff

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

from enum import Enum, auto
from pandas.api.types import is_scalar

class Thing(Enum):
    one = auto()
    two = auto()

print(is_scalar(Thing.one))  # False

Issue Description

pandas does not take Enums as a Scalar.

Inspired by pandas-dev/pandas-stubs#1288 (comment).

Expected Behavior

gives True

Installed Versions

INSTALLED VERSIONS

commit : c888af6
python : 3.13.5
python-bits : 64
OS : Windows
OS-release : 11
Version : 10.0.26100
machine : AMD64
processor : AMD64 Family 25 Model 116 Stepping 1, AuthenticAMD
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : Czech_Czechia.1252

pandas : 2.3.1
numpy : 2.2.6
pytz : 2023.4
dateutil : 2.9.0.post0
pip : 25.1.1
Cython : None
sphinx : None
IPython : 9.4.0
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.13.4
blosc : None
bottleneck : 1.5.0
dataframe-api-compat : None
fastparquet : None
fsspec : 2025.7.0
html5lib : None
hypothesis : 6.136.5
gcsfs : None
jinja2 : 3.1.6
lxml.etree : None
matplotlib : 3.10.3
numba : 0.61.2
numexpr : 2.11.0
odfpy : None
openpyxl : 3.1.5
pandas_gbq : None
psycopg2 : 2.9.10
pymysql : None
pyarrow : 19.0.1
pyreadstat : None
pytest : 8.4.1
python-calamine : None
pyxlsb : 1.0.10
s3fs : None
scipy : 1.16.1
sqlalchemy : 2.0.41
tables : None
tabulate : None
xarray : 2025.7.1
xlrd : 2.0.2
xlsxwriter : 3.2.5
zstandard : 0.23.0
tzdata : 2025.2
qtpy : None
pyqt5 : None

Metadata

Metadata

Labels

BugNeeds TriageIssue that has not been reviewed by a pandas team member

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions