From 523bc3d577988e01aaf9bbab8fddca043dacb7b6 Mon Sep 17 00:00:00 2001 From: Icaro Alves <33491428+Roxicaro@users.noreply.github.com> Date: Fri, 10 Oct 2025 16:05:35 -0300 Subject: [PATCH 1/2] Decorate period_range with set_module('pandas') --- pandas/core/indexes/period.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/indexes/period.py b/pandas/core/indexes/period.py index 19ea45bc80296..828f15a0a35ff 100644 --- a/pandas/core/indexes/period.py +++ b/pandas/core/indexes/period.py @@ -537,7 +537,7 @@ def shift(self, periods: int = 1, freq=None) -> Self: ) return self + periods - +@set_module("pandas") def period_range( start=None, end=None, From aa766b89fcf6c670fb7deaa4bd61cbb0b93295fa Mon Sep 17 00:00:00 2001 From: Icaro Alves <33491428+Roxicaro@users.noreply.github.com> Date: Fri, 10 Oct 2025 16:09:58 -0300 Subject: [PATCH 2/2] Added assert to test that the module string is set for period_range --- pandas/tests/api/test_api.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pandas/tests/api/test_api.py b/pandas/tests/api/test_api.py index 719b655a7c860..b347e24bc5268 100644 --- a/pandas/tests/api/test_api.py +++ b/pandas/tests/api/test_api.py @@ -524,6 +524,7 @@ def test_set_module(): assert pd.Series.__module__ == "pandas" assert pd.date_range.__module__ == "pandas" assert pd.bdate_range.__module__ == "pandas" + assert pd.period_range.__module__ == "pandas" assert pd.timedelta_range.__module__ == "pandas" assert pd.to_datetime.__module__ == "pandas" assert pd.to_timedelta.__module__ == "pandas"