Skip to content

feat: add WriteDisposition to replace "if_exists='fail'/'replace'/'append'" behavior #581

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

Closed
wants to merge 33 commits into from

Conversation

aribray
Copy link
Contributor

@aribray aribray commented Oct 25, 2022

Use LoadJobConfig.WriteDisposition to replace if_exists='fail'/'replace'/'append' behavior in to_gbq()

The WriteDisposition value specifies the action that occurs if destination table already exists.

  • if_exists="fail" ----> write_disposition="WRITE_EMPTY"
  • if_exists="append" ----> write_disposition="WRITE_APPEND"
  • if_exists="replace" ----> write_disposition="WRITE_TRUNCATE"

By using WriteDisposition, we can move away from the delete_and_recreate_table() behavior

Fixes #118 #43 #453

@product-auto-label product-auto-label bot added size: l Pull request size is large. api: bigquery Issues related to the googleapis/python-bigquery-pandas API. labels Oct 25, 2022
@aribray aribray added the owlbot:run Add this label to trigger the Owlbot post processor. label Oct 26, 2022
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Oct 26, 2022
@aribray aribray added the owlbot:run Add this label to trigger the Owlbot post processor. label Oct 26, 2022
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Oct 26, 2022
@aribray aribray added the owlbot:run Add this label to trigger the Owlbot post processor. label Oct 26, 2022
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Oct 26, 2022
@aribray aribray added the owlbot:run Add this label to trigger the Owlbot post processor. label Oct 26, 2022
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Oct 26, 2022
@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: l Pull request size is large. labels Oct 27, 2022
@aribray aribray closed this Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery-pandas API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CLN: Use WriteDisposition for if_exists=fail/replace/append behavior in to_gbq
2 participants