You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "zhengruifeng (via GitHub)" <gi...@apache.org> on 2024/10/23 07:03:18 UTC
[PR] [MINOR][PYTHON][DOCS] Fix the type hint for `extract`, `date_part` and `datepart` [spark]
zhengruifeng opened a new pull request, #48613:
URL: https://github.com/apache/spark/pull/48613
### 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
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [MINOR][PYTHON][DOCS] Fix the type hint for `extract`, `date_part` and `datepart` [spark]
Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng closed pull request #48613: [MINOR][PYTHON][DOCS] Fix the type hint for `extract`, `date_part` and `datepart`
URL: https://github.com/apache/spark/pull/48613
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [MINOR][PYTHON][DOCS] Fix the type hint for `extract`, `date_part` and `datepart` [spark]
Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng commented on PR #48613:
URL: https://github.com/apache/spark/pull/48613#issuecomment-2431669540
merged to master
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org