Skip to content

Commit

Permalink
Improve docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
betodealmeida committed Apr 3, 2024
1 parent d61018e commit 3f484bb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion superset/db_engine_specs/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2008,7 +2008,7 @@ def cancel_query( # pylint: disable=unused-argument
:param query: Query instance
:param cancel_query_id: Value returned by get_cancel_query_payload or set in
other life-cycle methods of the query
:return: True if query cancelled successfuly, False otherwise
:return: True if query cancelled successfully, False otherwise
"""

return False
Expand Down
11 changes: 11 additions & 0 deletions superset/utils/lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,17 @@ def KeyValueDistributedLock( # pylint: disable=invalid-name
) -> Iterator[uuid.UUID]:
"""
KV global lock for refreshing tokens.
This context manager acquires a distributed lock for a given namespace, with
optional parameters (eg, namespace="cache", user_id=1). It yields a UUID for the
lock that can be used within the context, and corresponds to the key in the KV
store.
:param namespace: The namespace for which the lock is to be acquired.
:type namespace: str
:param kwargs: Additional keyword arguments.
:yields: A unique identifier (UUID) for the acquired lock (the KV key).
:raises CreateKeyValueDistributedLockFailedException: If the lock is taken.
"""
# pylint: disable=import-outside-toplevel
from superset.commands.key_value.create import CreateKeyValueCommand
Expand Down

0 comments on commit 3f484bb

Please sign in to comment.