Skip to content

Commit

Permalink
Update default python version for python models (#1273)
Browse files Browse the repository at this point in the history
* update the default python version for python models; add a configuration file to collect future settings
  • Loading branch information
mikealfare authored Dec 13, 2024
1 parent b3eeb08 commit efc68e4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changes/unreleased/Under the Hood-20241211-170831.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Under the Hood
body: Update default Python version for python models
time: 2024-12-11T17:08:31.842063-05:00
custom:
Author: mikealfare
Issue: "1203"
1 change: 1 addition & 0 deletions dbt/adapters/snowflake/constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DEFAULT_PYTHON_VERSION_FOR_PYTHON_MODELS = "3.9"
5 changes: 4 additions & 1 deletion dbt/adapters/snowflake/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from dbt_common.exceptions import CompilationError, DbtDatabaseError, DbtRuntimeError
from dbt_common.utils import filter_null_values

from dbt.adapters.snowflake import constants
from dbt.adapters.snowflake.relation_configs import (
SnowflakeRelationType,
TableFormat,
Expand Down Expand Up @@ -345,7 +346,9 @@ def submit_python_job(self, parsed_model: dict, compiled_code: str):
schema = parsed_model["schema"]
database = parsed_model["database"]
identifier = parsed_model["alias"]
python_version = parsed_model["config"].get("python_version", "3.8")
python_version = parsed_model["config"].get(
"python_version", constants.DEFAULT_PYTHON_VERSION_FOR_PYTHON_MODELS
)

packages = parsed_model["config"].get("packages", [])
imports = parsed_model["config"].get("imports", [])
Expand Down

0 comments on commit efc68e4

Please sign in to comment.