Adovo

Data & Analytics

A dbt Fusion Python UDF may deploy more code than you wrote

Inspect the deployed BigQuery routine body during dbt Fusion migration and compare it with the intended function source.

November 8, 2026

A Python UDF may pass dbt build yet contain code that was never in its source file. An open dbt issue reports that Fusion 2.0.9 deployed a BigQuery Python UDF from functions/ with extra dbt scaffolding and build-environment identifiers in the routine body. The reporter compared it with dbt-core, which emitted only the user function. This is a deployment artifact discrepancy, not evidence that every Python model or warehouse behaves the same way.

Compare source with the warehouse object

List the UDF source and YAML configuration under functions/, then build only that function in a non-production project. Read routine_definition from BigQuery INFORMATION_SCHEMA.ROUTINES, as the issue reproduction does. Save a normalized diff between the intended source and deployed body. Record the dbt engine, adapter, package versions, project and dataset. The dbt UDF guide says dbt build creates the warehouse function from the source and property file; the deployed object is the contract downstream SQL actually calls.

Assess what the extra body changes

Determine whether the appended code affects runtime behavior, routine size, reviewability, or visibility of build-time identifiers. Avoid calling the identifiers a security breach without reviewing the routine’s grants and data classification. Run a small deterministic call and compare output across the two engines, but keep the body diff as a separate acceptance check; functional equality does not make an unexpected deployment artifact acceptable.

Gate the migration

Add a routine-definition check to the migration checklist for each language and adapter combination you use. For this reported version pair, hold production rollout of affected UDFs or obtain a tested workaround from dbt. If a later release changes the output, verify the deployed routine again rather than relying only on release-note language. Keep the routine definition and build logs with the support case.

Adovo’s view

The compiled artifact is the product, not the file in the repository. Data teams should review what the warehouse received, especially when an engine migration can alter executable code. A passing build is an input to trust, never the final evidence for it.

Continue exploring

Data & Analytics

dbtBigQuery

A dbt catalog flag can cost more than the BigQuery model build

Measure BigQuery catalog-query cost after a dbt v2 upgrade before adding --write-catalog to every local build.

Read more

Data & Analytics

dbtBigQuery

dbt seed fails on a legacy BigQuery domain project

Isolate a seed-only BigQuery project-ID failure during a dbt Fusion migration.

Read more

Data & Analytics

dbtBigQuery

dbt v2 BigQuery location lookup can widen IAM requirements

Investigate a dbt v2 BigQuery 403 caused by project-level SCHEMATA access when the runner is scoped to one dataset.

Read more
Explore data and analytics services →