chore: de-couple the telemetry events for each tutorial from the dataset on AWS that is used (#4155)

* removing old dataset telemetry events

* changing function name

* adding the datasets back for old tutorials

* fixing mini bug

* resolving cometns

* quick bug fix

* re-adding docstrings

* removing unnecessay import

* re-adding the telemetry event call for datasets

---------

Co-authored-by: Massimiliano Pippi <mpippi@gmail.com>
This commit is contained in:
Tuana Celik 2023-02-17 00:21:46 +01:00 committed by GitHub
parent e7bb2487eb
commit 8370715e7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -185,7 +185,6 @@ def send_custom_event(event: str = "", payload: Optional[Dict[str, Any]] = None)
def send_tutorial_event(url: str):
"""
Can be called when a tutorial dataset is downloaded so that the dataset URL is used to identify the tutorial and send an event.
:param url: URL of the dataset that is loaded in the tutorial.
"""
dataset_url_to_tutorial = {
@ -213,6 +212,14 @@ def send_tutorial_event(url: str):
send_custom_event(event=f"tutorial {dataset_url_to_tutorial.get(url, '?')} executed")
def tutorial_running(tutorial_id: int):
"""
Can be called when a tutorial is executed so that the tutorial_id is used to identify the tutorial and send an event.
:param tutorial_id: ID number of the tutorial
"""
send_custom_event(event=f"tutorial {tutorial_id} executed")
def _get_or_create_user_id() -> Optional[str]:
"""
Randomly generates a user id or loads the id defined in the config file and returns it.