From ce2570f9a936ea90c819005fb151787ddacd91bf Mon Sep 17 00:00:00 2001 From: Shing Chan Date: Mon, 11 Nov 2024 13:33:48 +0000 Subject: [PATCH] ENH: set __module__ on `date_range` and `bdate_range` (#60264) --- pandas/core/indexes/datetimes.py | 2 ++ pandas/tests/api/test_api.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/pandas/core/indexes/datetimes.py b/pandas/core/indexes/datetimes.py index b3d9c3bc78a66..9adbaadbdcdc8 100644 --- a/pandas/core/indexes/datetimes.py +++ b/pandas/core/indexes/datetimes.py @@ -816,6 +816,7 @@ def indexer_between_time( return mask.nonzero()[0] +@set_module("pandas") def date_range( start=None, end=None, @@ -1020,6 +1021,7 @@ def date_range( return DatetimeIndex._simple_new(dtarr, name=name) +@set_module("pandas") def bdate_range( start=None, end=None, diff --git a/pandas/tests/api/test_api.py b/pandas/tests/api/test_api.py index 00b0236c236c0..54e0453ed569b 100644 --- a/pandas/tests/api/test_api.py +++ b/pandas/tests/api/test_api.py @@ -418,3 +418,5 @@ def test_set_module(): assert pd.Timestamp.__module__ == "pandas" assert pd.Timedelta.__module__ == "pandas" assert pd.Series.__module__ == "pandas" + assert pd.date_range.__module__ == "pandas" + assert pd.bdate_range.__module__ == "pandas"