Skip to content

Commit ab37151

Browse files
authored
Remove dead code/constants from settings.py (#59822)
1 parent 27af41f commit ab37151

File tree

4 files changed

+4
-41
lines changed

4 files changed

+4
-41
lines changed

airflow-core/docs/administration-and-deployment/dag-serialization.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,11 @@ Add the following settings in ``airflow.cfg``:
7474
7575
# You can also update the following default configurations based on your needs
7676
min_serialized_dag_update_interval = 30
77-
min_serialized_dag_fetch_interval = 10
7877
max_num_rendered_ti_fields_per_task = 30
7978
compress_serialized_dags = False
8079
8180
* ``min_serialized_dag_update_interval``: This flag sets the minimum interval (in seconds) after which
8281
the serialized Dags in the DB should be updated. This helps in reducing database write rate.
83-
* ``min_serialized_dag_fetch_interval``: This option controls how often the Serialized Dag will be re-fetched
84-
from the DB when it is already loaded in the DagBag in the Webserver. Setting this higher will reduce
85-
load on the DB, but at the expense of displaying a possibly stale cached version of the Dag.
8682
* ``max_num_rendered_ti_fields_per_task``: This option controls the maximum number of Rendered Task Instance
8783
Fields (Template Fields) per task to store in the Database.
8884
* ``compress_serialized_dags``: This option controls whether to compress the Serialized Dag to the Database.

airflow-core/src/airflow/config_templates/config.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -367,14 +367,6 @@ core:
367367
type: boolean
368368
example: ~
369369
default: "False"
370-
min_serialized_dag_fetch_interval:
371-
description: |
372-
Fetching serialized DAG can not be faster than a minimum interval to reduce database
373-
read rate. This config controls when your DAGs are updated in the Webserver
374-
version_added: 1.10.12
375-
type: integer
376-
example: ~
377-
default: "10"
378370
max_num_rendered_ti_fields_per_task:
379371
description: |
380372
Maximum number of Rendered Task Instance Fields (Template Fields) per task to store

airflow-core/src/airflow/settings.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,12 @@
109109

110110
LOGGING_LEVEL = logging.INFO
111111

112-
# the prefix to append to gunicorn worker processes after init
113-
GUNICORN_WORKER_READY_PREFIX = "[ready] "
114-
115112
LOG_FORMAT = conf.get("logging", "log_format")
116113
SIMPLE_LOG_FORMAT = conf.get("logging", "simple_log_format")
117114

118115
SQL_ALCHEMY_CONN: str | None = None
119116
SQL_ALCHEMY_CONN_ASYNC: str | None = None
120117
PLUGINS_FOLDER: str | None = None
121-
DONOT_MODIFY_HANDLERS: bool | None = None
122118
DAGS_FOLDER: str = os.path.expanduser(conf.get_mandatory_value("core", "DAGS_FOLDER"))
123119

124120
AIO_LIBS_MAPPING = {"sqlite": "aiosqlite", "postgresql": "asyncpg", "mysql": "aiomysql"}
@@ -264,7 +260,6 @@ def configure_vars():
264260
global SQL_ALCHEMY_CONN_ASYNC
265261
global DAGS_FOLDER
266262
global PLUGINS_FOLDER
267-
global DONOT_MODIFY_HANDLERS
268263

269264
SQL_ALCHEMY_CONN = conf.get("database", "sql_alchemy_conn")
270265
if conf.has_option("database", "sql_alchemy_conn_async"):
@@ -276,13 +271,6 @@ def configure_vars():
276271

277272
PLUGINS_FOLDER = conf.get("core", "plugins_folder", fallback=os.path.join(AIRFLOW_HOME, "plugins"))
278273

279-
# If donot_modify_handlers=True, we do not modify logging handlers in task_run command
280-
# If the flag is set to False, we remove all handlers from the root logger
281-
# and add all handlers from 'airflow.task' logger to the root Logger. This is done
282-
# to get all the logs from the print & log statements in the DAG files before a task is run
283-
# The handlers are restored after the task completes execution.
284-
DONOT_MODIFY_HANDLERS = conf.getboolean("logging", "donot_modify_handlers", fallback=False)
285-
286274

287275
def _run_openlineage_runtime_check():
288276
"""
@@ -340,10 +328,6 @@ def get_bind(
340328

341329

342330
AIRFLOW_PATH = os.path.dirname(os.path.dirname(__file__))
343-
AIRFLOW_TESTS_PATH = os.path.join(AIRFLOW_PATH, "tests")
344-
AIRFLOW_SETTINGS_PATH = os.path.join(AIRFLOW_PATH, "airflow", "settings.py")
345-
AIRFLOW_UTILS_SESSION_PATH = os.path.join(AIRFLOW_PATH, "airflow", "utils", "session.py")
346-
AIRFLOW_MODELS_BASEOPERATOR_PATH = os.path.join(AIRFLOW_PATH, "airflow", "models", "baseoperator.py")
347331

348332

349333
def _is_sqlite_db_path_relative(sqla_conn_str: str) -> bool:
@@ -753,9 +737,6 @@ def initialize():
753737

754738

755739
# Const stuff
756-
757-
KILOBYTE = 1024
758-
MEGABYTE = KILOBYTE * KILOBYTE
759740
WEB_COLORS = {"LIGHTBLUE": "#4d9de0", "LIGHTORANGE": "#FF9933"}
760741

761742
# Updating serialized DAG can not be faster than a minimum interval to reduce database
@@ -765,10 +746,6 @@ def initialize():
765746
# If set to True, serialized DAGs is compressed before writing to DB,
766747
COMPRESS_SERIALIZED_DAGS = conf.getboolean("core", "compress_serialized_dags", fallback=False)
767748

768-
# Fetching serialized DAG can not be faster than a minimum interval to reduce database
769-
# read rate. This config controls when your DAGs are updated in the Webserver
770-
MIN_SERIALIZED_DAG_FETCH_INTERVAL = conf.getint("core", "min_serialized_dag_fetch_interval", fallback=10)
771-
772749
CAN_FORK = hasattr(os, "fork")
773750

774751
EXECUTE_TASKS_NEW_PYTHON_INTERPRETER = not CAN_FORK or conf.getboolean(

airflow-core/tests/unit/jobs/test_scheduler_job.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8112,12 +8112,11 @@ def test_execute_queries_count_with_harvested_dags(
81128112
{
81138113
("scheduler", "use_job_schedule"): "True",
81148114
("core", "load_examples"): "False",
8115-
# For longer running tests under heavy load, the min_serialized_dag_fetch_interval
8116-
# and min_serialized_dag_update_interval might kick-in and re-retrieve the record.
8115+
# For longer running tests under heavy load, the min_serialized_dag_update_interval
8116+
# might kick-in and re-retrieve the record.
81178117
# This will increase the count of serliazied_dag.py.get() count.
81188118
# That's why we keep the values high
81198119
("core", "min_serialized_dag_update_interval"): "100",
8120-
("core", "min_serialized_dag_fetch_interval"): "100",
81218120
}
81228121
),
81238122
):
@@ -8204,12 +8203,11 @@ def test_process_dags_queries_count(
82048203
conf_vars(
82058204
{
82068205
("scheduler", "use_job_schedule"): "True",
8207-
# For longer running tests under heavy load, the min_serialized_dag_fetch_interval
8208-
# and min_serialized_dag_update_interval might kick-in and re-retrieve the record.
8206+
# For longer running tests under heavy load, the min_serialized_dag_update_interval
8207+
# might kick-in and re-retrieve the record.
82098208
# This will increase the count of serliazied_dag.py.get() count.
82108209
# That's why we keep the values high
82118210
("core", "min_serialized_dag_update_interval"): "100",
8212-
("core", "min_serialized_dag_fetch_interval"): "100",
82138211
}
82148212
),
82158213
):

0 commit comments

Comments
 (0)