vincbeck commented on code in PR #58905:
URL: https://github.com/apache/airflow/pull/58905#discussion_r2585648422


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/variables.py:
##########
@@ -62,7 +62,9 @@ def delete_variable(
     session: SessionDep,
 ):
     """Delete a variable entry."""
-    if Variable.delete(variable_key, session) == 0:
+    result = session.execute(delete(Variable).where(Variable.key == 
variable_key))
+    rows = getattr(result, "rowcount", 0) or 0
+    if rows == 0:

Review Comment:
   No, it is not related to SQLA 1 -> 2. Similarly to why the get route is NOT 
using `Variable.get`, we should not use `Variable.set` here. `Variable.set` 
checks if the team passed as parameter if the same as the one associated to the 
variable (if any). Variable.set should only be executed in a task execution 
environment (execution API). Here, the public API, we want to simply delete the 
variable. The authorization check (whether the user is allowed to delete this 
variable) is already done by the dependency



##########
providers/amazon/src/airflow/providers/amazon/aws/secrets/secrets_manager.py:
##########
@@ -225,11 +225,12 @@ def get_conn_value(self, conn_id: str) -> str | None:
             return standardized_secret
         return secret
 
-    def get_variable(self, key: str) -> str | None:
+    def get_variable(self, key: str, team_id: str | None = None) -> str | None:

Review Comment:
   If we want to. If we want to teamify AWS Secret Manager yes, but that's a 
different change, then a different PR



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