Skip to content

Commit 99f0b35

Browse files
authored
Fix missing typing in metrics (#436)
1 parent f69ee07 commit 99f0b35

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/specklepy/logging/metrics.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
import queue
77
import sys
88
import threading
9-
from typing import Optional
109

1110
import requests
1211

12+
from specklepy.core.api.credentials import Account
13+
1314
"""
1415
Anonymous telemetry to help us understand how to make a better Speckle.
1516
This really helps us to deliver a better open source project and product!
@@ -54,16 +55,16 @@ def enable():
5455
TRACK = True
5556

5657

57-
def set_host_app(host_app: str, host_app_version: Optional[str] = None):
58+
def set_host_app(host_app: str, host_app_version: str | None = None):
5859
global HOST_APP, HOST_APP_VERSION
5960
HOST_APP = host_app
6061
HOST_APP_VERSION = host_app_version or HOST_APP_VERSION
6162

6263

6364
def track(
6465
action: str,
65-
account=None,
66-
custom_props: Optional[dict] = None,
66+
account: Account | None = None,
67+
custom_props: dict | None = None,
6768
):
6869
if not TRACK:
6970
return
@@ -91,7 +92,7 @@ def track(
9192
LOG.debug(f"Error queueing metrics request: {str(ex)}")
9293

9394

94-
def initialise_tracker(account=None):
95+
def initialise_tracker(account: Account | None = None):
9596
global METRICS_TRACKER
9697
if not METRICS_TRACKER:
9798
METRICS_TRACKER = MetricsTracker()

0 commit comments

Comments
 (0)