jason810496 commented on code in PR #71011:
URL: https://github.com/apache/airflow/pull/71011#discussion_r3721082667


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/variables.py:
##########
@@ -174,14 +174,7 @@ def post_variable(
 
     Variable.set(**post_body.model_dump(), session=session)
 
-    variable = session.scalar(select(Variable).where(Variable.key == 
post_body.key).limit(1))
-    if variable is None:
-        raise HTTPException(
-            status.HTTP_404_NOT_FOUND,
-            f"Variable with key: `{post_body.key}` was not found",
-        )
-
-    return variable
+    return session.scalar(select(Variable).where(Variable.key == 
post_body.key).limit(1))

Review Comment:
   We shouldn't change the route implementation.



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