Skip to content

refactor: Unify gbq execution as semi-executor#16770

Merged
TrevorBergeron merged 17 commits into
mainfrom
task_engine
May 13, 2026
Merged

refactor: Unify gbq execution as semi-executor#16770
TrevorBergeron merged 17 commits into
mainfrom
task_engine

Conversation

@TrevorBergeron
Copy link
Copy Markdown
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the BigFrames execution framework by replacing CacheSpec with TempTableSpec and restructuring BigQueryCachingExecutor to use a recursive _execute_bigquery method. The DirectGbqExecutor was also updated to handle the new ExecutionSpec. Several critical issues were identified in the refactored code, including missing attributes in DirectGbqExecutor (storage_manager, bqstoragereadclient, _labels, and metrics), a missing publisher argument in its constructor call, and an invalid lifetime field usage in TableOutputSpec. Furthermore, the DirectGbqExecutor currently ignores its configured compiler function, which will lead to incorrect behavior when a custom compiler is provided.

Comment thread packages/bigframes/bigframes/session/bq_caching_executor.py
Comment thread packages/bigframes/bigframes/session/bq_caching_executor.py Outdated
Comment thread packages/bigframes/bigframes/session/direct_gbq_execution.py Outdated
Comment thread packages/bigframes/bigframes/session/direct_gbq_execution.py Outdated
Comment thread packages/bigframes/bigframes/session/direct_gbq_execution.py
Comment thread packages/bigframes/bigframes/session/direct_gbq_execution.py Outdated
Comment thread packages/bigframes/bigframes/session/direct_gbq_execution.py Outdated
@TrevorBergeron TrevorBergeron marked this pull request as ready for review May 8, 2026 23:39
@TrevorBergeron TrevorBergeron requested review from a team as code owners May 8, 2026 23:39
@TrevorBergeron TrevorBergeron requested review from GarrettWu and removed request for a team May 8, 2026 23:39


def start_query_with_client(
def start_query_job_optional(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

don't quite get what "optional" means here. Can it be more descriptive or add a doc string?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added docstring in new rev

bqstoragereadclient: google.cloud.bigquery_storage_v1.BigQueryReadClient,
*,
publisher: bigframes.core.events.Publisher,
compiler: Literal["ibis", "sqlglot"] = "ibis",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we want to use sqlglot by default or still ibis?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah, will do sqlglot, switched in new rev

@TrevorBergeron TrevorBergeron enabled auto-merge (squash) May 13, 2026 00:26
@TrevorBergeron TrevorBergeron merged commit a4bc576 into main May 13, 2026
31 checks passed
@TrevorBergeron TrevorBergeron deleted the task_engine branch May 13, 2026 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants