Skip to content

Commit

Permalink
Set default identity
Browse files Browse the repository at this point in the history
Signed-off-by: Elena Khaustova <ymax70rus@gmail.com>
  • Loading branch information
ElenaKhaustova committed Sep 10, 2024
1 parent 3da39f7 commit 1219fc3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kedro-telemetry/kedro_telemetry/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
CONFIG_FILENAME = "telemetry.toml"
PYPROJECT_CONFIG_NAME = "pyproject.toml"
UNDEFINED_PACKAGE_NAME = "undefined_package_name"
MISSING_USER_IDENTITY = "missing_user_identity"

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -240,7 +241,7 @@ def _send_telemetry_heap_event(self, event_name: str):
try:
_send_heap_event(
event_name=event_name,
identity=self._user_uuid,
identity=self._user_uuid if self._user_uuid else MISSING_USER_IDENTITY,
properties=self._event_properties,
)
self._sent = True
Expand Down Expand Up @@ -323,9 +324,8 @@ def _send_heap_event(
"event": event_name,
"timestamp": datetime.now().strftime(TIMESTAMP_FORMAT),
"properties": properties or {},
"identity": identity,
}
if identity:
data["identity"] = identity

try:
resp = requests.post(
Expand Down

0 comments on commit 1219fc3

Please sign in to comment.