Feat: implement support for bigframes#3620
Merged
tobymao merged 1 commit intoSQLMesh:mainfrom Jan 15, 2025
Merged
Conversation
8f25d05 to
10d89b8
Compare
Contributor
georgesittas
left a comment
There was a problem hiding this comment.
Awesome, thanks for driving this! LGTM, just one question to make sure the imports are safe. Will let others chime in here too.
georgesittas
approved these changes
Jan 13, 2025
tobymao
reviewed
Jan 13, 2025
fix: fix a few issues chore: use optional import pattern WIP
10d89b8 to
9f2f442
Compare
tobymao
approved these changes
Jan 15, 2025
Contributor
Author
|
FYI @tobymao this PR is good to merge whenever you all want to, the test failure is completely unrelated I think. |
Contributor
Yeah, this test is flaky for some reason, no need to worry about it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I PR'ed the upstream lib so that they have no upper bound on their SQLGlot pin. This means the library is now fully compatible with SQLMesh. This PR adds support. Instead of bundling the extra with bigquery, I have temporarily added it to its own extra so it is opt-in. Once they cut a version release, we can add it with a proper
>=version specifier.This enables many novel uses such as using Gemini / LLM capabilities at scale more effectively, using ML models (training , predicting, etc), and so on leveraging BigQuery's compute through a dataframe interface wrapped intuitively by
sqlmesh's python model system.https://cloud.google.com/bigquery/docs/use-bigquery-dataframes#pandas-examples
https://github.com/googleapis/python-bigquery-dataframes/blob/main/notebooks/getting_started/ml_fundamentals_bq_dataframes.ipynb
I have tested this locally. I was able to crunch through 35G in 15 seconds with no local computation. Its very nice.
The following example requires no seeds or pre-loaded data as it leverages BQ's open datasets. You can run this with or without the remote function.
Support was simple given the way the
query_factoryworks and similar art with Snowpark. Very straightforward. Good work on that.You can even do interesting things like include a read from a gcs bucket in BQ engine: