Repository navigation
feat: configurable upload limits - #520
Merged
mtcarlone merged 8 commits intoNov 6, 2026
Merged
Conversation
kempspo
had a problem deploying
to
Approve Integration Tests
August 24, 2025 02:53 — with
GitHub Actions
Failure
kempspo
had a problem deploying
to
Approve Integration Tests
August 24, 2025 02:53 — with
GitHub Actions
Failure
kempspo
had a problem deploying
to
Approve Integration Tests
August 24, 2025 02:53 — with
GitHub Actions
Failure
kempspo
had a problem deploying
to
Approve Integration Tests
August 24, 2025 02:53 — with
GitHub Actions
Failure
kempspo
had a problem deploying
to
Approve Integration Tests
August 24, 2025 02:53 — with
GitHub Actions
Failure
kempspo
had a problem deploying
to
Approve Integration Tests
August 24, 2025 02:53 — with
GitHub Actions
Failure
kempspo
had a problem deploying
to
Approve Integration Tests
August 24, 2025 02:53 — with
GitHub Actions
Failure
kempspo
had a problem deploying
to
Approve Integration Tests
August 24, 2025 02:53 — with
GitHub Actions
Failure
kempspo
had a problem deploying
to
Approve Integration Tests
August 24, 2025 02:53 — with
GitHub Actions
Failure
kempspo
had a problem deploying
to
Approve Integration Tests
August 24, 2025 02:53 — with
GitHub Actions
Failure
Contributor
Author
|
@mtcarlone could i get you to take a look at this one |
mtcarlone
requested changes
Jul 31, 2026
mtcarlone
left a comment
Contributor
There was a problem hiding this comment.
Not backwards compatible
| {% else %} | ||
| {% set upload_limit = 300 if target.type == 'bigquery' else 5000 %} | ||
| {% endif %} | ||
| {% set upload_limit = var('insert_batch_size')[dataset if dataset == 'models' else 'default'] %} |
Contributor
There was a problem hiding this comment.
@kempspo can you rework this so is backwards compatible? CI failed because the variable is not set, and that will cause real failures in other projects.
The batch sizes were added under `models: dbt_artifacts:` in
dbt_project.yml, which is model config rather than `vars:`, so
var('insert_batch_size') didn't exist and every on-run-end hook failed
with "Required var 'insert_batch_size' not found". The rendered values
would also have been strings, which range() rejects.
The adapter defaults now live in upload_results: 100 rows per insert for
models and 5,000 for other datasets, or 50 and 300 on BigQuery and
Trino, keeping this PR's move of Trino into the smaller pool. Consumers
override them with dbt_artifacts_insert_batch_size, a mapping keyed by
'models', 'default' or a dataset name; keys it leaves out keep their
defaults. Values are cast to integers, so strings from env_var() work,
and a non-mapping var or a value below 1 raises a clear compile error.
The dbt_artifacts_ prefix matches the package's other vars and avoids
dbt_project_evaluator's insert_batch_size, a single integer there, which
consumers may set globally.
Explain the default chunk sizes, why BigQuery and Trino use smaller ones (Trino's query.max-length, QUERY_TEXT_TOO_LARGE), and how to override them per dataset.
A new singular test compares, for the previous `dbt build`, each manifest dataset's row count and distinct node_id count with the number of nodes of that type in the project graph, so a chunk boundary that drops or repeats rows fails it. The DuckDB tox envs' first build now uploads with dbt_artifacts_insert_batch_size set to 7 for models and 2 for everything else, which splits most datasets into several chunks for the second build's tests to check. Verified it fails when one model row is duplicated, and passes on DuckDB and SQL Server.
mtcarlone
self-requested a review
November 5, 2026 22:24
mtcarlone
approved these changes
Nov 5, 2026
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.
Overview
Allow users to configure upload limits and add Trino to lower default limits (similar to BigQuery).
Update type - breaking / non-breaking
What does this solve?
Trino can run into
QUERY_TEXT_TOO_LARGEerrors. Not all users can/want to reconfigure their Trino instances to handle larger text queries.This implementation allows the user to instead configure the batching to lower/higher as needed and adds trino to the smaller default pool.
This implmentation takes the same idea from dbt Lab's dbt_project_evaluator.
Outstanding questions
What databases have you tested with?