Skip to content

Commit

Permalink
docs(scope): Add docstring to Scope.set_tags
Browse files Browse the repository at this point in the history
  • Loading branch information
szokeasaurusrex committed Apr 26, 2024
1 parent 689fab5 commit ab11fb7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions sentry_sdk/scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,6 +801,21 @@ def set_tag(self, key, value):

def set_tags(self, tags):
# type: (Mapping[str, object]) -> None
"""Sets multiple tags at once.
This method updates multiple tags at once. The tags are passed as a dictionary
or other mapping type.
Calling this method is equivalent to calling `set_tag` on each key-value pair
in the mapping. If a tag key already exists in the scope, its value will be
updated. If the tag key does not exist in the scope, the key-value pair will
be added to the scope.
This method only modifies tag keys in the `tags` mapping passed to the method.
`scope.set_tags({})` is, therefore, a no-op.
:param tags: A mapping of tag keys to tag values to set.
"""
self._tags.update(tags)

def remove_tag(self, key):
Expand Down

0 comments on commit ab11fb7

Please sign in to comment.