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

PostgresToGoogleCloudStorageOperator - BigQuery schema type for time zone naive fields #22536

Conversation

pierrejeambrun
Copy link
Member

@pierrejeambrun pierrejeambrun commented Mar 25, 2022

Fixes #11547

The idea here is to use DATETIME, DATE. and TIME fields in bigquery when the postgres columns is defined timezone naive.(timestamp, date, time <=> to timestamp without timezone, date without timezone and time without timezone)

I had to modify the convert_type function as BigQuery cannot import data for DATETIME, DATE. and TIME fields from a timestamp.

I also added some tests for that function. (Similar to what we have in airflow/providers/google/cloud/transfers/mysql_to_gcs.py)

screen2
screen1

@boring-cyborg boring-cyborg bot added area:providers provider:google Google (including GCP) related issues labels Mar 25, 2022
@pierrejeambrun pierrejeambrun force-pushed the 11547-postgres-to-google-cloud-storage-operator-fix-unaware-date-schema-type branch from f5df540 to 4decd64 Compare March 25, 2022 23:02
@pierrejeambrun
Copy link
Member Author

Hello @eladkal,

Here is the first draft for the PR.

Best,

@pierrejeambrun pierrejeambrun force-pushed the 11547-postgres-to-google-cloud-storage-operator-fix-unaware-date-schema-type branch from c03fe0e to f68145f Compare March 26, 2022 09:56
@pierrejeambrun pierrejeambrun force-pushed the 11547-postgres-to-google-cloud-storage-operator-fix-unaware-date-schema-type branch from f68145f to b5a7ffa Compare March 26, 2022 10:44
@github-actions
Copy link

The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main or amend the last commit of the PR, and push it with --force-with-lease.

@github-actions github-actions bot added the okay to merge It's ok to merge this PR as it does not require more tests label Mar 27, 2022
@eladkal eladkal merged commit 3887239 into apache:main Mar 27, 2022
@pierrejeambrun pierrejeambrun deleted the 11547-postgres-to-google-cloud-storage-operator-fix-unaware-date-schema-type branch March 27, 2022 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:providers okay to merge It's ok to merge this PR as it does not require more tests provider:google Google (including GCP) related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PostgresToGoogleCloudStorageOperator - Custom schema mapping
2 participants