Skip to content

BUG: no type provided for pandas.api.extensions.no_default #60488

Closed
@mballintijn

Description

@mballintijn

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

import pandas as pd
from pandas.testing import assert_frame_equal
from pandas.api.extensions import NoDefault, no_default

def my_wrapper(a: pd.DataFrame, b: pd.DataFrame, atol: NoDefault = no_default) -> None:
    """Example function that cannot be written"""
    assert_frame_equal(a, b, atol=atol)
    return

Issue Description

No type is provided for the pandas.api.extensions.no_default sentinel.

This is a problem when trying to type annotate functions or methods that forward arguments into Pandas functions that accept the no_default sentinel.

Expected Behavior

To be able to import and use the type NoDefault of no_default

Installed Versions

INSTALLED VERSIONS
------------------
commit                : d9cdd2ee5a58015ef6f4d15c7226110c9aab8140
python                : 3.12.7.final.0
python-bits           : 64
OS                    : Windows
OS-release            : 10
Version               : 10.0.19045
machine               : AMD64
processor             : AMD64 Family 25 Model 1 Stepping 1, AuthenticAMD
byteorder             : little
LC_ALL                : None
LANG                  : None
LOCALE                : English_United States.1252
pandas                : 2.2.2
numpy                 : 1.26.4
pytz                  : 2024.1
dateutil              : 2.9.0
setuptools            : 75.1.0
pip                   : 24.2
Cython                : None
pytest                : 8.3.3
hypothesis            : None
sphinx                : None
blosc                 : None
feather               : None
xlsxwriter            : 3.2.0
lxml.etree            : 5.3.0
html5lib              : None
pymysql               : None
psycopg2              : None
jinja2                : 3.1.4
IPython               : 8.27.0
pandas_datareader     : None
adbc-driver-postgresql: None
adbc-driver-sqlite    : None
bs4                   : 4.12.3
bottleneck            : None
dataframe-api-compat  : None
fastparquet           : None
fsspec                : 2024.5.0
gcsfs                 : None
matplotlib            : 3.9.2
numba                 : None
numexpr               : None
odfpy                 : None
openpyxl              : 3.1.5
pandas_gbq            : None
pyarrow               : 17.0.0
pyreadstat            : None
python-calamine       : None
pyxlsb                : None
s3fs                  : None
scipy                 : 1.12.0
sqlalchemy            : 2.0.34
tables                : None
tabulate              : 0.9.0
xarray                : None
xlrd                  : 2.0.1
zstandard             : 0.23.0
tzdata                : 2024.1
qtpy                  : None
pyqt5                 : None

Metadata

Metadata

Assignees

Labels

EnhancementTypingtype annotations, mypy/pyright type checking

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions