Skip to content

Commit

Permalink
add param
Browse files Browse the repository at this point in the history
  • Loading branch information
dstandish committed Nov 12, 2024
1 parent bbf1ce1 commit c6add3d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions airflow/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,14 @@ def load_policy_plugins(pm: pluggy.PluginManager):
pm.load_setuptools_entrypoints("airflow.policy")


def _get_async_conn_uri_from_sync():
scheme, rest = SQL_ALCHEMY_CONN.split(":", maxsplit=1)
def _get_async_conn_uri_from_sync(sync_uri):
scheme, rest = sync_uri.split(":", maxsplit=1)
scheme = scheme.split("+", maxsplit=1)[0]
aiolib = AIO_LIBS_MAPPING.get(scheme)
if aiolib:
return f"{scheme}+{aiolib}:{rest}"
else:
return SQL_ALCHEMY_CONN
return sync_uri


def configure_vars():
Expand All @@ -227,7 +227,7 @@ def configure_vars():
global PLUGINS_FOLDER
global DONOT_MODIFY_HANDLERS
SQL_ALCHEMY_CONN = conf.get("database", "SQL_ALCHEMY_CONN")
SQL_ALCHEMY_CONN_ASYNC = _get_async_conn_uri_from_sync()
SQL_ALCHEMY_CONN_ASYNC = _get_async_conn_uri_from_sync(sync_uri=SQL_ALCHEMY_CONN)

DAGS_FOLDER = os.path.expanduser(conf.get("core", "DAGS_FOLDER"))

Expand Down

0 comments on commit c6add3d

Please sign in to comment.