Commit be18b7c
committed
[MINOR][PYTHON][DOCS] Fix the type hint for
### What changes were proposed in this pull request?
Fix the type hint for `extract`, `date_part` and `datepart`
### Why are the changes needed?
argument `field` never supports column name:
```python
In [6]: df = spark.createDataFrame([(datetime.datetime(2015, 4, 8, 13, 8, 15), "YEAR",)], ['ts', 'field'])
In [7]: df.select(sf.extract("field", "ts"))
...
AnalysisException: [NON_FOLDABLE_ARGUMENT] The function `extract` requires the parameter `field` to be a foldable expression of the type "STRING", but the actual argument is a non-foldable. SQLSTATE: 42K08
```
### Does this PR introduce _any_ user-facing change?
yes, doc only change
### How was this patch tested?
ci
### Was this patch authored or co-authored using generative AI tooling?
no
Closes #48613 from zhengruifeng/fix_extract_hint.
Authored-by: Ruifeng Zheng <[email protected]>
Signed-off-by: Ruifeng Zheng <[email protected]>extract, date_part and datepart
1 parent 35d2ef9 commit be18b7c
File tree
2 files changed
+9
-9
lines changed- python/pyspark/sql
- connect/functions
- functions
2 files changed
+9
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3190 | 3190 | | |
3191 | 3191 | | |
3192 | 3192 | | |
3193 | | - | |
| 3193 | + | |
3194 | 3194 | | |
3195 | 3195 | | |
3196 | 3196 | | |
3197 | 3197 | | |
3198 | 3198 | | |
3199 | 3199 | | |
3200 | | - | |
| 3200 | + | |
3201 | 3201 | | |
3202 | 3202 | | |
3203 | 3203 | | |
3204 | 3204 | | |
3205 | 3205 | | |
3206 | 3206 | | |
3207 | | - | |
| 3207 | + | |
3208 | 3208 | | |
3209 | 3209 | | |
3210 | 3210 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8564 | 8564 | | |
8565 | 8565 | | |
8566 | 8566 | | |
8567 | | - | |
| 8567 | + | |
8568 | 8568 | | |
8569 | 8569 | | |
8570 | 8570 | | |
8571 | 8571 | | |
8572 | 8572 | | |
8573 | 8573 | | |
8574 | 8574 | | |
8575 | | - | |
| 8575 | + | |
8576 | 8576 | | |
8577 | 8577 | | |
8578 | 8578 | | |
| |||
8600 | 8600 | | |
8601 | 8601 | | |
8602 | 8602 | | |
8603 | | - | |
| 8603 | + | |
8604 | 8604 | | |
8605 | 8605 | | |
8606 | 8606 | | |
8607 | 8607 | | |
8608 | 8608 | | |
8609 | 8609 | | |
8610 | 8610 | | |
8611 | | - | |
| 8611 | + | |
8612 | 8612 | | |
8613 | 8613 | | |
8614 | 8614 | | |
| |||
8637 | 8637 | | |
8638 | 8638 | | |
8639 | 8639 | | |
8640 | | - | |
| 8640 | + | |
8641 | 8641 | | |
8642 | 8642 | | |
8643 | 8643 | | |
8644 | 8644 | | |
8645 | 8645 | | |
8646 | 8646 | | |
8647 | 8647 | | |
8648 | | - | |
| 8648 | + | |
8649 | 8649 | | |
8650 | 8650 | | |
8651 | 8651 | | |
| |||
0 commit comments