Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[SPARK-55800][PYTHON] Remove the unused type check for datetime.date#54581

Open
gaogaotiantian wants to merge 2 commits intoapache:masterfrom
gaogaotiantian:fix-expression-datetime
Open

[SPARK-55800][PYTHON] Remove the unused type check for datetime.date#54581
gaogaotiantian wants to merge 2 commits intoapache:masterfrom
gaogaotiantian:fix-expression-datetime

Conversation

@gaogaotiantian
Copy link
Contributor

What changes were proposed in this pull request?

We check if an object is an instance of datetime.date when it could be datetime.datetime - that's unnecessary and pointless because datetime.datetime is a subclass of datetime.date. It's documented in python docs so it's guaranteed.

We can also safely convert a datetime.datetime object directly. (We have been doing that for a long time).

Why are the changes needed?

Remove unnecessary and misleading logic.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

CI.

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

No.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants