vincbeck commented on code in PR #41414:
URL: https://github.com/apache/airflow/pull/41414#discussion_r1715383343
##########
airflow/models/variable.py:
##########
@@ -167,6 +166,35 @@ def set(
This operation overwrites an existing variable.
+ :param key: Variable Key
+ :param value: Value to set for the Variable
+ :param description: Description of the Variable
+ :param serialize_json: Serialize the value to a JSON string
+ :param session: Session
+ """
+ Variable._set(
+ key=key, value=value, description=description,
serialize_json=serialize_json, session=session
+ )
+ # invalidate key in cache for faster propagation
+ # we cannot save the value set because it's possible that it's
shadowed by a custom backend
+ # (see call to check_for_write_conflict above)
+ SecretCache.invalidate_variable(key)
Review Comment:
I dont much about the cost of `SecretCache.invalidate_variable(key)`. If you
tell me the cost is not high then we can leave it as is. But if the cost is
considerable (CPU/memory/latency) then yes we should do something about it.
Since it seems it is negligible, I am fine keeping it as is
##########
airflow/models/variable.py:
##########
@@ -167,6 +166,35 @@ def set(
This operation overwrites an existing variable.
+ :param key: Variable Key
+ :param value: Value to set for the Variable
+ :param description: Description of the Variable
+ :param serialize_json: Serialize the value to a JSON string
+ :param session: Session
+ """
+ Variable._set(
+ key=key, value=value, description=description,
serialize_json=serialize_json, session=session
+ )
+ # invalidate key in cache for faster propagation
+ # we cannot save the value set because it's possible that it's
shadowed by a custom backend
+ # (see call to check_for_write_conflict above)
+ SecretCache.invalidate_variable(key)
Review Comment:
I dont know much about the cost of `SecretCache.invalidate_variable(key)`.
If you tell me the cost is not high then we can leave it as is. But if the cost
is considerable (CPU/memory/latency) then yes we should do something about it.
Since it seems it is negligible, I am fine keeping it as is
--
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]