amoghrajesh commented on code in PR #44449:
URL: https://github.com/apache/airflow/pull/44449#discussion_r1861929113


##########
airflow/api_fastapi/execution_api/routes/variables.py:
##########
@@ -67,6 +67,20 @@ def get_variable(variable_key: str, token: deps.TokenDep) -> 
VariableResponse:
     return VariableResponse(key=variable_key, value=variable_value)
 
 
[email protected](
+    "",
+    responses={
+        status.HTTP_401_UNAUTHORIZED: {"description": "Unauthorized"},
+        status.HTTP_403_FORBIDDEN: {"description": "Task does not have access 
to the variable"},
+    },
+)
+def post_variable(body: VariablePostBody, token: deps.TokenDep) -> 
VariableResponse:

Review Comment:
   Right.
   
   Two reasons i chose POST `/execution/variables` over the other one:
   1. `variable_key` and `key` again in the payload didn't feel too right as it 
was avoidable duplication.
   2. We have to handle cases where `variable_key` in the parameters and `key` 
in the payload are potentially different. Could be quite chaotic!
   
   Also, legacy implements it this way!



-- 
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]

Reply via email to