Skip to content

[SPARK-55408][PS] Handle unexpected keyword argument errors related to datetime with pandas 3#54191

Open
ueshin wants to merge 2 commits intoapache:masterfrom
ueshin:issues/SPARK-55408/kwargs
Open

[SPARK-55408][PS] Handle unexpected keyword argument errors related to datetime with pandas 3#54191
ueshin wants to merge 2 commits intoapache:masterfrom
ueshin:issues/SPARK-55408/kwargs

Conversation

@ueshin
Copy link
Member

@ueshin ueshin commented Feb 6, 2026

What changes were proposed in this pull request?

Handles an unexpected keyword argument error related to datetime with pandas 3.

Why are the changes needed?

There are removed arguments in datetime-related functions.

  • the constructor of DatetimeIndex: normalize, closed
  • to_datetime: infer_datetime_format

Does this PR introduce any user-facing change?

Yes, it will behave more like pandas 3.

How was this patch tested?

Updated a related test and the other existing tests should pass.

Was this patch authored or co-authored using generative AI tooling?

No.

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

JIRA Issue Information

=== Sub-task SPARK-55408 ===
Summary: Handle unexpected keyword argument errors related to datetime with pandas 3
Assignee: None
Status: Open
Affected: ["4.2.0"]


This comment was automatically generated by GitHub Actions

@ueshin
Copy link
Member Author

ueshin commented Feb 6, 2026

@ueshin ueshin changed the title [SPARK-55408][PS] Handle an unexpected keyword argument error related to datetime with pandas 3 [SPARK-55408][PS] Handle unexpected keyword argument errors related to datetime with pandas 3 Feb 6, 2026
kwargs["closed"] = closed
else:
if normalize is not _NoValue:
raise ValueError(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed as well as the same error at 509aa00.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants