Fix missing typing in metrics (#436)
Publish Python Package / test (push) Has been cancelled
Publish Python Package / Build and Publish Python Package (push) Has been cancelled

This commit is contained in:
Jedd Morgan
2025-09-04 16:42:19 +01:00
committed by GitHub
parent f69ee07a94
commit 99f0b3516a
+6 -5
View File
@@ -6,10 +6,11 @@ import platform
import queue
import sys
import threading
from typing import Optional
import requests
from specklepy.core.api.credentials import Account
"""
Anonymous telemetry to help us understand how to make a better Speckle.
This really helps us to deliver a better open source project and product!
@@ -54,7 +55,7 @@ def enable():
TRACK = True
def set_host_app(host_app: str, host_app_version: Optional[str] = None):
def set_host_app(host_app: str, host_app_version: str | None = None):
global HOST_APP, HOST_APP_VERSION
HOST_APP = host_app
HOST_APP_VERSION = host_app_version or HOST_APP_VERSION
@@ -62,8 +63,8 @@ def set_host_app(host_app: str, host_app_version: Optional[str] = None):
def track(
action: str,
account=None,
custom_props: Optional[dict] = None,
account: Account | None = None,
custom_props: dict | None = None,
):
if not TRACK:
return
@@ -91,7 +92,7 @@ def track(
LOG.debug(f"Error queueing metrics request: {str(ex)}")
def initialise_tracker(account=None):
def initialise_tracker(account: Account | None = None):
global METRICS_TRACKER
if not METRICS_TRACKER:
METRICS_TRACKER = MetricsTracker()