jscheffl commented on code in PR #44330:
URL: https://github.com/apache/airflow/pull/44330#discussion_r1864566571
##########
providers/src/airflow/providers/edge/worker_api/routes/_v2_routes.py:
##########
@@ -268,3 +265,40 @@ def set_state_v2(worker_name: str, body: dict[str, Any],
session=NEW_SESSION) ->
return set_state(worker_name, request_obj, session)
except HTTPException as e:
return e.to_response() # type: ignore[attr-defined]
+
+
+def logfile_path_v2(
+ dag_id: str,
+ task_id: str,
+ run_id: str,
+ try_number: int,
+ map_index: str, # Note: Connexion can not have negative numbers in path
parameters, use string therefore
+) -> str:
+ """Handle Edge Worker API
`/edge_worker/v1/logs/logfile_path/{dag_id}/{task_id}/{run_id}/{try_number}/{map_index}`
endpoint for Airflow 2.10."""
+ try:
+ auth = request.headers.get("Authorization", "")
+ jwt_token_authorization(request.path, auth)
+ return logfile_path(dag_id, task_id, run_id, try_number,
int(map_index))
Review Comment:
The negative integer bus is within flask, which will be gone when we remove
Connexion... which we drop when we drop Airflow 2.10 support... when we have
Airflow 3. But no real harm. It is just a workaround to have support for
`map_index=-1` :-D .
--
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]