Skip to content

Commit ab53530

Browse files
author
MarcoGorelli
committed
fixup
1 parent f2d9eb9 commit ab53530

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pandas/io/parsers/readers.py

+12
Original file line numberDiff line numberDiff line change
@@ -903,8 +903,20 @@ def read_csv(
903903
"A strict version of it is now the default, see "
904904
"https://pandas.pydata.org/pdeps/0004-consistent-to-datetime-parsing.html. "
905905
"You can safely remove this argument.",
906+
FutureWarning,
907+
stacklevel=find_stack_level(),
908+
)
909+
if date_parser is not None:
910+
warnings.warn(
911+
"The argument 'date_parser' is deprecated and will "
912+
"be removed in a future version. "
913+
"Please use 'date_format' instead, or read your data in as 'object' dtype "
914+
"and then call 'to_datetime'.",
915+
FutureWarning,
906916
stacklevel=find_stack_level(),
907917
)
918+
if date_parser is not None and date_format is not None:
919+
raise TypeError("Cannot use both 'date_parser' and 'date_format'")
908920
# locals() should never be modified
909921
kwds = locals().copy()
910922
del kwds["filepath_or_buffer"]

0 commit comments

Comments
 (0)