googleapis / python-bigquery-sqlalchemy

SQLAlchemy dialect for BigQuery
MIT License
436 stars 130 forks source link

Feat: Update partitioning by DATE, DATETIME, TIMESTAMP, _PARTITIONDATE #1113

Open chalmerlowe opened 2 months ago

chalmerlowe commented 2 months ago

This adds some additional functionality to properly handle partitioning of columns with the following datatypes.

Where appropriate, ensures the following functions can be used with/or without the following TimePartitioningTypes (HOUR, DAY, MONTH, YEAR).

This is a nearly complete fix for #1072. The table from #1072 is included here: NOTE: This PR does not handle _PARTITIONTIME

Column Data Type HOUR DAY MONTH YEAR
DATE N/A Fixed by https://github.com/googleapis/python-bigquery-sqlalchemy/pull/1057 via DATE_TRUNC via DATE_TRUNC
DATETIME Incorrectly implemented via DATE_TRUNC TODO: use  DATETIME_TRUNC Incorrectly implemented via DATE_TRUNC TODO: use  DATETIME_TRUNC Incorrectly implemented via DATE_TRUNC TODO: use  DATETIME_TRUNC Incorrectly implemented via DATE_TRUNC TODO: use  DATETIME_TRUNC
TIMESTAMP via TIMESTAMP_TRUNC via TIMESTAMP_TRUNC via TIMESTAMP_TRUNC via TIMESTAMP_TRUNC
_PARTITIONDATE N/A N/A N/A N/A
_PARTITIONTIME Not currently implemented TODO: USE TIMESTAMP_TRUNC Not currently implemented TODO: USE TIMESTAMP_TRUNC Not currently implemented TODO: USE TIMESTAMP_TRUNC Not currently implemented TODO: USE TIMESTAMP_TRUNC
conventional-commit-lint-gcf[bot] commented 2 months ago

🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!

-- conventional-commit-lint bot https://conventionalcommits.org/