Skip to content

Commit 3de365f

Browse files
committed
feat: added docstrings
1 parent ef17444 commit 3de365f

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

openfeature_flagsmith/provider.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ def track(
4444
evaluation_context: typing.Optional[EvaluationContext] = None,
4545
tracking_event_details: typing.Optional[TrackingEventDetails] = None,
4646
) -> None:
47+
"""
48+
Records a custom event via the Flagsmith client's pipeline analytics.
49+
50+
No-ops if the client lacks pipeline analytics support or configuration.
51+
An explicit ``tracking_event_details.value`` overrides any same-named
52+
key in ``attributes``.
53+
"""
4754
# Guard against older flagsmith versions or duck-typed clients
4855
# that don't have track_event.
4956
if not hasattr(self._client, "track_event"):
@@ -68,6 +75,8 @@ def track(
6875
metadata=metadata,
6976
)
7077
except ValueError:
78+
# Flagsmith raises ValueError when pipeline analytics is not
79+
# configured; OpenFeature spec requires track() to no-op.
7180
return
7281

7382
def get_metadata(self) -> Metadata:

0 commit comments

Comments
 (0)