Skip to content

Commit

Permalink
add docstring for entity action span decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-mchok committed Nov 14, 2024
1 parent b77d135 commit cef9f19
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/snowflake/cli/api/entities/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@ class EntityActions(str, Enum):


def attach_spans_to_entity_actions(entity_name: str):
def decorator(cls):
"""
Class decorator for EntityBase subclasses to automatically wrap
every implemented entity action method with a metrics span
Args:
entity_name (str): Custom name for entity type to be displayed in metrics
"""

def decorator(cls: type[EntityBase]) -> type[EntityBase]:
for attr_name, attr_value in vars(cls).items():
is_entity_action = attr_name in [
enum_member for enum_member in EntityActions
Expand Down

0 comments on commit cef9f19

Please sign in to comment.