Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate datetime documentation to code #12966

Conversation

jatin510
Copy link
Contributor

Which issue does this PR close?

Closes #12859

Closes #.

Rationale for this change

Documentation migration

What changes are included in this PR?

Documentation related changes for datetime functions.

Are these changes tested?

Yes.

Are there any user-facing changes?

@github-actions github-actions bot added documentation Improvements or additions to documentation functions labels Oct 16, 2024
@alamb alamb changed the title Feature/12859 migrate docs for datetime functions to code Migrate datetime documentation to code Oct 16, 2024
@jonathanc-n
Copy link
Contributor

LGTM, honestly the with_standard_argument isn't a necessary change, just enforces consistency.

@jatin510
Copy link
Contributor Author

@jonathanc-n
I checked and found:
Only two functions take an argument of a single data type:
date_bin - Time
from_unixtime - Integer

But it is changing the meaning of the sentence

for `date_bin`
 #### Arguments
 
 - **interval**: Bin interval.
-- **expression**: Time expression to operate on. Can be a constant, column, or function.
+- **expression**: Time expression to operate on. Can be a constant, column, or function, and any combination of operators.
 - **origin-timestamp**: Optional. Starting point used to determine bin boundaries. If not specified defaults 1970-01-01T00:00:00Z (the UNIX epoch in UTC).
 
 The following intervals are supported:
@@ -1958,7 +1958,7 @@ from_unixtime(expression)
 
for `from_unixtime`
 #### Arguments
 
-- **expression**: Expression to operate on. Can be a constant, column, or function, and any combination of arithmetic operators.
+- **expression**: Integer expression to operate on. Can be a constant, column, or function, and any combination of operators.

So, I am not going with the use of with_standard_argument.

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing -- thank you @jatin510 🙏

- [date_trunc](#date_trunc)
- [datetrunc](#datetrunc)
- [date_part](#date_part)
- [datepart](#datepart)
- [extract](#extract)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is extract a special function? I think it might be as it has special syntax

@alamb
Copy link
Contributor

alamb commented Oct 16, 2024

I merged up from main to resolve some conflicts with this PR

@jonathanc-n
Copy link
Contributor

@jatin510

.with_standard_argument('expression', None) is used for when it is just 'expression' at the beginning. In the example you showed that would be with_standard_argument("expression", Some("time"))

@jonathanc-n
Copy link
Contributor

@jatin510 Oh, sorry about the confusion there, i got confused, the commit hasn't been pushed yet.

@alamb alamb merged commit f718fe2 into apache:main Oct 17, 2024
25 checks passed
@alamb
Copy link
Contributor

alamb commented Oct 17, 2024

Thanks again @jatin510 and @jonathanc-n -- sorry we can't merge these PRs faster. It is all we can do to keep up with reviews these days :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate documentation for all datetime functions from scalar_functions.md to code
3 participants