[SPARK-57742][PYTHON] Add truncation disclaimer to unix_micros docstring#56853
Open
jubins wants to merge 1 commit into
Open
[SPARK-57742][PYTHON] Add truncation disclaimer to unix_micros docstring#56853jubins wants to merge 1 commit into
jubins wants to merge 1 commit into
Conversation
### What is the purpose of the change Fixes SPARK-57742 — adds `"Truncates higher levels of precision."` to the one-line description of `unix_micros`, making it consistent with `unix_millis` and `unix_seconds` which already carry this disclaimer. This became a practical gap once `unix_nanos` (SPARK-57579) made nanosecond-precision timestamps (`TIMESTAMP_LTZ(9)` / `TIMESTAMP_NTZ(9)`) usable: a user passing such a column to `unix_micros` has no indication from the docstring that sub-microsecond digits will be silently dropped. ### Brief change log - `python/pyspark/sql/functions/builtin.py`: appended `"Truncates higher levels of precision."` to the one-line summary of `unix_micros`, matching `unix_millis` and `unix_seconds` ### Verifying this change This is a documentation-only change. No behaviour is altered. - [ ] Confirm `unix_micros` docstring now reads: `"Returns the number of microseconds since 1970-01-01 00:00:00 UTC. Truncates higher levels of precision."` - [ ] Confirm `unix_millis` and `unix_seconds` already carry the same sentence (consistency check) ### Does this pull request potentially affect one of the following parts - Dependencies (does it add or upgrade a dependency): no - The public API, i.e., is any changed class annotated with `@Public`/`@Evolving`: no — docstring only - The serializers: no - The runtime per-record code paths (performance sensitive): no - Anything that affects deployment or recovery: no - The S3 file system connector: no ### Documentation Does this pull request introduce a new feature? No — this is a docstring fix. ### Was generative AI tooling used to co-author this PR? Yes — Claude Code was used as a pair-programming assistant. All changes were reviewed and verified by the author. Generated-by: Claude Opus 4.8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
Fixes SPARK-57742 — adds
"Truncates higher levels of precision."to the one-line description ofunix_micros, making it consistent withunix_millisandunix_secondswhich already carry this disclaimer.This became a practical gap once
unix_nanos(SPARK-57579) made nanosecond-precision timestamps (TIMESTAMP_LTZ(9)/TIMESTAMP_NTZ(9)) usable: a user passing such a column tounix_microshas no indication from the docstring that sub-microsecond digits will be silently dropped.Brief change log
python/pyspark/sql/functions/builtin.py: appended"Truncates higher levels of precision."to the one-line summary ofunix_micros, matchingunix_millisandunix_secondsVerifying this change
This is a documentation-only change. No behaviour is altered.
unix_microsdocstring now reads:"Returns the number of microseconds since 1970-01-01 00:00:00 UTC. Truncates higher levels of precision."unix_millisandunix_secondsalready carry the same sentence (consistency check)Does this pull request potentially affect one of the following parts
@Public/@Evolving: no — docstring onlyDocumentation
Does this pull request introduce a new feature? No — this is a docstring fix.
Was generative AI tooling used to co-author this PR?