Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion airflow-core/src/airflow/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,9 @@ def initialize():

configure_adapters()
# The webservers import this file from models.py with the default settings.
configure_orm()

if not os.environ.get("PYTHON_OPERATORS_VIRTUAL_ENV_MODE", None):
configure_orm()
configure_action_logging()

# mask the sensitive_config_values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ from __future__ import annotations

import {{ pickling_library }}
import sys
import os
# Setting the PYTHON_OPERATORS_VIRTUAL_ENV_MODE environment variable to 1,
# helps to avoid the issue of re creating the orm session in the settings file, otherwise
# it fails with airflow-db-not-allowed

os.environ["PYTHON_OPERATORS_VIRTUAL_ENV_MODE"] = "1"
{% if expect_airflow %}
{# Check whether Airflow is available in the environment.
# If it is, we'll want to ensure that we integrate any macros that are being provided
Expand Down
Loading