Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit efc68e4

Browse files
authored
Update default python version for python models (#1273)
* update the default python version for python models; add a configuration file to collect future settings
1 parent b3eeb08 commit efc68e4

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
kind: Under the Hood
2+
body: Update default Python version for python models
3+
time: 2024-12-11T17:08:31.842063-05:00
4+
custom:
5+
Author: mikealfare
6+
Issue: "1203"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DEFAULT_PYTHON_VERSION_FOR_PYTHON_MODELS = "3.9"

dbt/adapters/snowflake/impl.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from dbt_common.exceptions import CompilationError, DbtDatabaseError, DbtRuntimeError
2323
from dbt_common.utils import filter_null_values
2424

25+
from dbt.adapters.snowflake import constants
2526
from dbt.adapters.snowflake.relation_configs import (
2627
SnowflakeRelationType,
2728
TableFormat,
@@ -345,7 +346,9 @@ def submit_python_job(self, parsed_model: dict, compiled_code: str):
345346
schema = parsed_model["schema"]
346347
database = parsed_model["database"]
347348
identifier = parsed_model["alias"]
348-
python_version = parsed_model["config"].get("python_version", "3.8")
349+
python_version = parsed_model["config"].get(
350+
"python_version", constants.DEFAULT_PYTHON_VERSION_FOR_PYTHON_MODELS
351+
)
349352

350353
packages = parsed_model["config"].get("packages", [])
351354
imports = parsed_model["config"].get("imports", [])

0 commit comments

Comments
 (0)