You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(bigquery): make table description length configurable - #6273
Add max_table_comment_length to BigQuery connection configuration. SQLMesh uses 1,024 characters by default and accepts configured limits from 1 to 16,384 for table and view descriptions. Set max_table_comment_length: 16384 on the gateway connection to use BigQuery’s full description quota. BigQuery quotas
Test Plan
test_bigquery.py and test_connection_config.py passed with 129 tests.
Covered the default and configured limits in SQL for table creation, CTAS, comment updates, views, and materialized views. Tested validation for values outside the supported range.
make style passed.
Checklist
I have run make style and fixed any issues
I have added tests for my changes (if applicable)
All existing tests pass (make fast-test)
My commits are signed off (git commit -s) per the DCO
Summary by CodeRabbit
New Features
BigQuery connections now support a configurable maximum length for table and view descriptions. The default is 1,024 characters; values from 1 to 16,384 are supported.
Documentation
Updated the BigQuery connection options reference with the new setting and its accepted range.
No actionable comments were generated in the recent review.
Walkthrough
BigQuery connection configuration now accepts an optional table-comment length limit from 1 to 16,384. The adapter uses that limit when truncating table comments and retains the 1,024-character default when the option is unset. Tests and documentation cover the setting.
Changes: BigQuery table comment length
Layer / File(s)
Summary
Configure and apply the comment limit sqlmesh/core/config/connection.py, sqlmesh/core/engine_adapter/bigquery.py, tests/core/engine_adapter/test_bigquery.py, docs/integrations/engines/bigquery.md
The connection config validates and passes the optional limit to the adapter. The adapter applies it during comment truncation. Tests cover default and configured limits and reject values outside the allowed range. The documentation describes the option and its default.
This adds an optional BigQuery setting for the table and view description length limit. Existing behavior is unchanged when the setting is not used, so merge-readiness risk is minimal.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: BigQuery table description length becomes configurable through a new max_table_comment_length setting. The changeset adds that setting to the connection config, the ad…
Description check
The description follows the template's main sections. It has a Description that states the new max_table_comment_length option, its default of 1,024 and its range of 1 to 16,384, and it references iss…
Linked Issues check
Issue #5581 asks whether the 1,024-character BigQuery table comment limit has a rationale, and whether it can match BigQuery's 16,384-character quota. The PR does not change the default. It adds an op…
Out of Scope Changes check
All changed areas connect to the linked issue. sqlmesh/core/config/connection.py adds the new config field and passes it in the extra engine configuration. sqlmesh/core/engine_adapter/bigquery.py …
Full details: Title check
Explanation
The title names the main change: BigQuery table description length becomes configurable through a new max_table_comment_length setting. The changeset adds that setting to the connection config, the adapter truncation helper, and tests, so the title matches the primary change.
Full details: Description check
Explanation
The description follows the template's main sections. It has a Description that states the new max_table_comment_length option, its default of 1,024 and its range of 1 to 16,384, and it references issue #5581. The Test Plan lists the test files, the covered SQL cases, and the validation tests. The Checklist is present. One checklist item is unchecked: the author did not run make fast-test, and the description does not explain why.
Full details: Linked Issues check
Explanation
Issue #5581 asks whether the 1,024-character BigQuery table comment limit has a rationale, and whether it can match BigQuery's 16,384-character quota. The PR does not change the default. It adds an optional max_table_comment_length field to BigQueryConnectionConfig (ge=1, le=16_384, default None). When set, the BigQuery adapter truncates table comments to that value. When unset, it falls back to MAX_TABLE_COMMENT_LENGTH (1,024). This lets users opt in to the full 16,384-character quota, which meets the practical need in the issue. The issue asks whether the team would consider raising the default. It does not require a default change, so the coding requirement is met. The tests cover default and configured limits for table creation, CTAS, comment updates, views, and materialized views, and cover out-of-range validation (0 and 16,385 raise ValidationError). The evidence is the PR summary and description; I did not inspect the source diff directly. No unresolved gap affects the verdict.
Full details: Out of Scope Changes check
Explanation
All changed areas connect to the linked issue. sqlmesh/core/config/connection.py adds the new config field and passes it in the extra engine configuration. sqlmesh/core/engine_adapter/bigquery.py adds _truncate_table_comment, which applies the configured limit in the existing table-comment SQL builder. tests/core/engine_adapter/test_bigquery.py tests the default and configured limits and the validation bounds. docs/integrations/engines/bigquery.md documents the new option. No unrelated behavior change appears in the summary.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: 1cf26a8f-bc93-4c7a-8efe-ac602676cc9d
Commits
Reviewing files that changed from the base of the PR and between ce229ae and 512c3fc.
Files selected for processing: 4
docs/integrations/engines/bigquery.md
sqlmesh/core/config/connection.py
sqlmesh/core/engine_adapter/bigquery.py
tests/core/engine_adapter/test_bigquery.py
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.
Could a SQLMesh maintainer approve the GitHub Actions workflows for this PR? Both CI and the DCO check are awaiting approval. Thanks!
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
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.
Description
Fixes #5581.
Add
max_table_comment_lengthto BigQuery connection configuration. SQLMesh uses 1,024 characters by default and accepts configured limits from 1 to 16,384 for table and view descriptions. Setmax_table_comment_length: 16384on the gateway connection to use BigQuery’s full description quota. BigQuery quotasTest Plan
test_bigquery.pyandtest_connection_config.pypassed with 129 tests.make stylepassed.Checklist
make styleand fixed any issuesmake fast-test)git commit -s) per the DCOSummary by CodeRabbit