Skip to content

feat(databricks): accept Python model environment_key on serverless submit - #15968

Open
sd-db wants to merge 3 commits into
dbt-labs:mainfrom
sd-db:sd-db/fix/python-model-environment-key
Open

feat(databricks): accept Python model environment_key on serverless submit#15968
sd-db wants to merge 3 commits into
dbt-labs:mainfrom
sd-db:sd-db/fix/python-model-environment-key

Conversation

@sd-db

@sd-db sd-db commented Aug 17, 2026

Copy link
Copy Markdown

Fixes #15781

Upstream: databricks/dbt-databricks#1636

Problem

Fusion parse rejects Databricks Python model YAML config.environment_key and environment_dependencies as unused (UnusedConfigKey, dbt1060). dbt-databricks already consumes those keys on serverless Jobs submit.

Solution

  • Recognize environment_key and environment_dependencies on Fusion model config (schema.yml and dbt_project.yml).
  • On serverless notebook submit, set task environment_key and auto-build job-level environments when dependencies are set (environment_version: "4"), matching dbt-databricks.
  • If the user sets python_job_config.environments, keep that value. Empty [] is treated as unset, same as v1.

Testing

Ran a serverless Python model (environment_key + environment_dependencies) live on Databricks with both dbt-databricks and Fusion. Parse no longer raises UnusedConfigKey. Create and rerun both succeeded, the Python model table matched, and jobs/runs/get?include_resolved_values=true returned the same resolved spec on both engines (environment_key, environment_version: "4", dependencies).

Unit tests cover YAML key recognition (including unused-key behavior) and the Jobs submit payload (auto-build, user environments override, empty []).

Checklist

  • I have read the contributing guide and understand what's expected of me.
  • I have run this code in development, and it appears to resolve the stated issue.
  • This PR includes tests, or tests are not required or relevant for this PR.
  • This PR has no interface changes (e.g., macros, CLI, logs, JSON artifacts, config files, adapter interface, etc.) or this PR has already received feedback and approval from Product or DX.
  • This PR includes type annotations for new and modified functions.

sd-db added 2 commits August 17, 2026 17:05
…ubmit

Fusion treated YAML environment_key and environment_dependencies as unused
config (dbt1060). Recognize those keys and pass them through Jobs submit
the same way dbt-databricks does.

Fixes dbt-labs#15966
v1 treats [] as missing and still auto-builds the serverless environment
spec. Match that, and keep the submit path a bit simpler.
@sd-db
sd-db requested a review from a team as a code owner August 17, 2026 12:15
@cla-bot cla-bot Bot added the cla:yes label Aug 17, 2026
codescene-delta-analysis[bot]

This comment was marked as outdated.

Drop the boolean environments helper and the extract_packages wrapper.
Reuse build_notebook_task in workflow submit without applying environment_key.

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Gates Failed
Enforce advisory code health rules (2 files with Large Method, Complex Method)

Our agent can fix these. Install it.

Gates Passed
3 Quality Gates Passed

Reason for failure
Enforce advisory code health rules Violations Code Health Impact
manifest_nodes.rs 1 advisory rule 6.76 → 6.74 Suppress
model_config.rs 2 advisory rules 2.60 → 2.59 Suppress

See analysis details in CodeScene

Quality Gate Profile: Clean Code Collective
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[v2 Bug][Databricks] Support serverless Python environment configuration

1 participant