diff --git a/airflow/models/variable.py b/airflow/models/variable.py index 4b3e4f77e47e1..b4cf5560e8421 100644 --- a/airflow/models/variable.py +++ b/airflow/models/variable.py @@ -165,34 +165,6 @@ 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) - - @staticmethod - @provide_session - def _set( - key: str, - value: Any, - description: str | None = None, - serialize_json: bool = False, - session: Session = None, - ) -> None: - """ - Set a value for an Airflow Variable with a given Key. - - This operation overwrites an existing variable. - :param key: Variable Key :param value: Value to set for the Variable :param description: Description of the Variable @@ -225,26 +197,6 @@ def update( """ Update a given Airflow Variable with the Provided value. - :param key: Variable Key - :param value: Value to set for the Variable - :param serialize_json: Serialize the value to a JSON string - :param session: Session - """ - Variable._update(key=key, value=value, serialize_json=serialize_json, session=session) - # We need to invalidate the cache for internal API cases on the client side - SecretCache.invalidate_variable(key) - - @staticmethod - @provide_session - def _update( - key: str, - value: Any, - serialize_json: bool = False, - session: Session = None, - ) -> None: - """ - Update a given Airflow Variable with the Provided value. - :param key: Variable Key :param value: Value to set for the Variable :param serialize_json: Serialize the value to a JSON string @@ -268,18 +220,6 @@ def delete(key: str, session: Session = None) -> int: """ Delete an Airflow Variable for a given key. - :param key: Variable Keys - """ - rows = Variable._delete(key=key, session=session) - SecretCache.invalidate_variable(key) - return rows - - @staticmethod - @provide_session - def _delete(key: str, session: Session = None) -> int: - """ - Delete an Airflow Variable for a given key. - :param key: Variable Keys """ rows = session.execute(delete(Variable).where(Variable.key == key)).rowcount