jscheffl commented on code in PR #44454:
URL: https://github.com/apache/airflow/pull/44454#discussion_r1863935217
##########
providers/src/airflow/providers/edge/cli/edge_command.py:
##########
@@ -59,29 +57,6 @@
)
-@providers_configuration_loaded
-def force_use_internal_api_on_edge_worker():
- """
- Ensure that the environment is configured for the internal API without
needing to declare it outside.
-
- This is only required for an Edge worker and must to be done before the
Click CLI wrapper is initiated.
- That is because the CLI wrapper will attempt to establish a DB connection,
which will fail before the
- function call can take effect. In an Edge worker, we need to "patch" the
environment before starting.
- """
- if "airflow" in sys.argv[0] and sys.argv[1:3] == ["edge", "worker"]:
- api_url = conf.get("edge", "api_url")
- if not api_url:
- raise SystemExit("Error: API URL is not configured, please correct
configuration.")
- logger.info("Starting worker with API endpoint %s", api_url)
- # export Edge API to be used for internal API
- os.environ["AIRFLOW_ENABLE_AIP_44"] = "True"
- os.environ["AIRFLOW__CORE__INTERNAL_API_URL"] = api_url
- InternalApiConfig.set_use_internal_api("edge-worker")
Review Comment:
Args. This was a bit tooo much removal ... because if this removed the start
now fails in
airflow/executors/executor_loader.py:validate_database_executor_compatibility()
with `error: cannot use SQLite with the...`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]