Commit 1323ab5
[SPARK-55800][PYTHON] Remove the unused type check for datetime.date
### 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.
Closes apache#54581 from gaogaotiantian/fix-expression-datetime.
Authored-by: Tian Gao <gaogaotiantian@hotmail.com>
Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>1 parent c2a739f commit 1323ab5
1 file changed
Lines changed: 2 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
| 301 | + | |
| 302 | + | |
306 | 303 | | |
307 | 304 | | |
308 | 305 | | |
| |||
0 commit comments