Skip to content

Migrate datetime documentation to code - #12966

Merged
alamb merged 6 commits into
apache:mainfrom
jatin510:feature/12859-migrate-docs-for-datetime-functions-to-code
Oct 17, 2024
Merged

Migrate datetime documentation to code#12966
alamb merged 6 commits into
apache:mainfrom
jatin510:feature/12859-migrate-docs-for-datetime-functions-to-code

Conversation

@jatin510

Copy link
Copy Markdown
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-actionsgithub-actionsBot added documentation Improvements or additions to documentation functions Changes to functions implementation labels Oct 16, 2024
@alambalamb changed the title Feature/12859 migrate docs for datetime functions to codeMigrate datetime documentation to codeOct 16, 2024
@jonathanc-n

Copy link
Copy Markdown
Contributor

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

@jatin510

Copy link
Copy Markdown
ContributorAuthor

@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.

@alambalamb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Amazing -- thank you @jatin510 🙏

- [datetrunc](#datetrunc)
- [date_part](#date_part)
- [datepart](#datepart)
- [extract](#extract)

Copy link
Copy Markdown
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
Copy Markdown
Contributor

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

@jonathanc-n

Copy link
Copy Markdown
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
Copy Markdown
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:mainOct 17, 2024
@alamb

Copy link
Copy Markdown
Contributor

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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationfunctionsChanges to functions implementation

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

@jatin510@jonathanc-n@alamb