Skip to content

Commit

Permalink
Use default_factory instead of calling the method in dataclass (#38948)
Browse files Browse the repository at this point in the history
  • Loading branch information
hussein-awala authored Apr 15, 2024
1 parent 76e2b72 commit 58820a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions dev/breeze/src/airflow_breeze/global_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ def get_airflow_version():
return airflow_version


@lru_cache(maxsize=None)
def get_airflow_extras():
airflow_dockerfile = AIRFLOW_SOURCES_ROOT / "Dockerfile"
with open(airflow_dockerfile) as dockerfile:
Expand Down
4 changes: 2 additions & 2 deletions dev/breeze/src/airflow_breeze/params/build_prod_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import json
import re
import sys
from dataclasses import dataclass
from dataclasses import dataclass, field

from airflow_breeze.branch_defaults import AIRFLOW_BRANCH, DEFAULT_AIRFLOW_CONSTRAINTS_BRANCH
from airflow_breeze.global_constants import (
Expand All @@ -43,7 +43,7 @@ class BuildProdParams(CommonBuildParams):
airflow_constraints_mode: str = "constraints"
airflow_constraints_reference: str = DEFAULT_AIRFLOW_CONSTRAINTS_BRANCH
cleanup_context: bool = False
airflow_extras: str = get_airflow_extras()
airflow_extras: str = field(default_factory=get_airflow_extras)
disable_airflow_repo_cache: bool = False
disable_mssql_client_installation: bool = False
disable_mysql_client_installation: bool = False
Expand Down

0 comments on commit 58820a9

Please sign in to comment.