Skip to content

Commit ba8cbb0

Browse files
committed
few changes to warning messages
1 parent 54ce63e commit ba8cbb0

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

doc/source/whatsnew/v1.0.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ Other enhancements
222222
- :meth:`DataFrame.sort_values` and :meth:`Series.sort_values` have gained ``ignore_index`` keyword to be able to reset index after sorting (:issue:`30114`)
223223
- :meth:`DataFrame.to_markdown` and :meth:`Series.to_markdown` added (:issue:`11052`)
224224
- :meth:`DataFrame.drop_duplicates` has gained ``ignore_index`` keyword to reset index (:issue:`30114`)
225-
- The ``pandas.datetime`` submodule is now deprecated. Import ``datetime`` directly instead(:issue:`30296`)
225+
- The ``pandas.datetime`` class is now deprecated. Import from ``datetime`` instead(:issue:`30296`)
226226

227227

228228
Build Changes

pandas/__init__.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,9 @@ class Panel:
210210

211211
elif name == "datetime":
212212
warnings.warn(
213-
"The pandas.datetime module is deprecated "
213+
"The pandas.datetime class is deprecated "
214214
"and will be removed from pandas in a future version. "
215-
"Import datetime directly instead.",
215+
"Import from datetime module instead.",
216216
FutureWarning,
217217
stacklevel=2,
218218
)
@@ -293,15 +293,15 @@ def __init__(self):
293293

294294
def __getattr__(self, item):
295295
self.warnings.warn(
296-
"The pandas.datetime module is deprecated "
296+
"The pandas.datetime class is deprecated "
297297
"and will be removed from pandas in a future version. "
298-
"Import datetime directly instead",
298+
"Import from datetime instead",
299299
FutureWarning,
300300
stacklevel=2,
301301
)
302302

303303
try:
304-
return getattr(self.datetime, item)
304+
return getattr(dt, item)
305305
except AttributeError:
306306
raise AttributeError(f"module datetime has no attribute {item}")
307307

0 commit comments

Comments
 (0)