gaogaotiantian commented on code in PR #54191:
URL: https://github.com/apache/spark/pull/54191#discussion_r2776468529
##########
python/pyspark/pandas/indexes/datetimes.py:
##########
@@ -152,6 +131,39 @@ def __new__(
if freq is not _NoValue:
kwargs["freq"] = freq
+ if LooseVersion(pd.__version__) < "3.0.0":
+ if normalize is not _NoValue:
+ warnings.warn(
+ "The 'normalize' keyword in DatetimeIndex construction is
deprecated "
+ "and will be removed in a future version.",
+ FutureWarning,
+ )
+ kwargs["normalize"] = normalize
+ else:
+ kwargs["normalize"] = False
+ if closed is not _NoValue:
+ warnings.warn(
+ "The 'closed' keyword in DatetimeIndex construction is
deprecated "
+ "and will be removed in a future version.",
+ FutureWarning,
+ )
+ kwargs["closed"] = closed
+ else:
+ if normalize is not _NoValue:
+ raise ValueError(
Review Comment:
I don't remember how we deal with other removed arguments, but unexpected
keyword argument should probably raise a `TypeError` (I think `pandas` does it
too, well it's probably Python that does the job).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]