"""Thread-local storage for the Snowflake query tag.""" import threading _local = threading.local() def set_query_tag(value): """Set the query tag for the current thread. Args: value (str): Query tag value. """ _local.value = value def get_query_tag(): """Get the query tag for the current thread. Returns: str: Query tag value, or None if not set. """ return getattr(_local, 'value', None) def clear_query_tag(): """Clear the query tag for the current thread.""" _local.value = None