fix: anonymous id as env var (#1106)

<!-- .github/pull_request_template.md -->

## Description
<!-- Provide a clear description of the changes in this PR -->

## DCO Affirmation
I affirm that all code in every commit of this pull request conforms to
the terms of the Topoteretes Developer Certificate of Origin.
This commit is contained in:
Boris 2025-07-18 17:56:08 +02:00 committed by GitHub
parent 01bab3f0c7
commit 43a21342a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -54,6 +54,11 @@ def extract_pos_tags(sentence):
def get_anonymous_id():
"""Creates or reads a anonymous user id"""
tracking_id = os.getenv("TRACKING_ID", None)
if tracking_id:
return tracking_id
home_dir = str(pathlib.Path(pathlib.Path(__file__).parent.parent.parent.resolve()))
if not os.path.isdir(home_dir):