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

feat: support UPDATE + JOIN in BigQuery dialect #1083

Merged
merged 19 commits into from
Jun 13, 2024

Conversation

Linchin
Copy link
Contributor

@Linchin Linchin commented Jun 6, 2024

The parent class SQLCompiler doesn't implement update_from_clause(), and thus does not support UPDATE + JOIN. This PR uses the implementation in PostgreSQL to support this.

Thanks to @brian-pond for the thorough investigation!

P.S.
We added a third_party folder to vendor a code snippet from the postgresql portion of the sqlalchemy code. For future reference, in order to add vendored code, we need to do the following (for the exact change detail, check the content of this PR):

  • copy the minimum necessary code
  • Add the license files of the vendored project
  • add init.py files for necessary modules
  • in setup.py, add the vendored path and package to setup()
  • use sqlalchemy_bigquery_vendored as the package name instead of third_party because third_party is used in many different places
  • update owlbot.py so owlbot doesn't undo the change
  • add pyproject.toml so setuptools installs the modules in the third_party folder, see develop mode does not respect src structure pypa/setuptools#230 (comment)
  • add third_party to lint path

Thanks to @tswast for helping figure out the copyright and code vendoring details 🙂

Fixes #1010 🦕

@Linchin Linchin requested review from a team as code owners June 6, 2024 21:52
@Linchin Linchin requested a review from tswast June 6, 2024 21:52
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: bigquery Issues related to the googleapis/python-bigquery-sqlalchemy API. labels Jun 6, 2024
@Linchin Linchin added the owlbot:run Add this label to trigger the Owlbot post processor. label Jun 11, 2024
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jun 11, 2024
@Linchin Linchin added the owlbot:run Add this label to trigger the Owlbot post processor. label Jun 11, 2024
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jun 11, 2024
@Linchin Linchin added the owlbot:run Add this label to trigger the Owlbot post processor. label Jun 11, 2024
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jun 11, 2024
@Linchin Linchin added the owlbot:run Add this label to trigger the Owlbot post processor. label Jun 12, 2024
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jun 12, 2024
@Linchin Linchin added the owlbot:run Add this label to trigger the Owlbot post processor. label Jun 12, 2024
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jun 12, 2024
Copy link
Collaborator

@chalmerlowe chalmerlowe left a comment

Choose a reason for hiding this comment

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

I have several comments.

MANIFEST.in Show resolved Hide resolved
owlbot.py Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
@Linchin Linchin added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 13, 2024
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 13, 2024
Copy link
Collaborator

@chalmerlowe chalmerlowe left a comment

Choose a reason for hiding this comment

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

LGTM

@chalmerlowe chalmerlowe added kokoro:force-run Add this label to force Kokoro to re-run the tests. owlbot:run Add this label to trigger the Owlbot post processor. labels Jun 13, 2024
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jun 13, 2024
@yoshi-kokoro yoshi-kokoro removed kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Jun 13, 2024
@Linchin Linchin merged commit d766d21 into googleapis:main Jun 13, 2024
15 checks passed
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-sqlalchemy API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing support for UPDATE + JOIN in BigQuery dialect.
5 participants