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

Support a timestamp construction/alteration API in PyDough similar to the sqlite DATETIME function #208

Open
knassre-bodo opened this issue Jan 10, 2025 · 0 comments
Labels
documentation Improvements or additions to documentation effort - medium mid-sized issue with average implementation time/difficulty enhancement New feature or request user feature Adding a new user-facing feature/functionality

Comments

@knassre-bodo
Copy link
Contributor

knassre-bodo commented Jan 10, 2025

This function should be able to do the following:

  • Construct a datetime from its first argument which can be a datetime string, the word 'now' (meaning get the current timestamp), or a datetime literal (datetime.date, datetime.datetime, pandas.Timestamp)
  • Use its subsequent arguments as modifiers:
    • Add/subtract year/month/day/hour/minute/second intervals by string: DATETIME('now', '-1 month', '+3 days'))
    • Truncates to start of the year, month, day in SQLite (or to the hour, minute, second in ANSI): DATETIME("now", "start of month")
  • For SQlite, uses the sqlite datetime function accordingly
  • For ANSI, uses a mix of CURRENT_DATE, CAST(... AS TIMESTAMP), ± INTERVAL 'x UNIT', and DATE_TRUNC
@knassre-bodo knassre-bodo added documentation Improvements or additions to documentation enhancement New feature or request user feature Adding a new user-facing feature/functionality effort - medium mid-sized issue with average implementation time/difficulty labels Jan 10, 2025
@knassre-bodo knassre-bodo changed the title Support a date construction/alteration API in PyDough similar to the sqlite DATE function Support a timestamp construction/alteration API in PyDough similar to the sqlite DATETIME function Feb 12, 2025
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 effort - medium mid-sized issue with average implementation time/difficulty enhancement New feature or request user feature Adding a new user-facing feature/functionality
Projects
None yet
Development

No branches or pull requests

1 participant