From 3e437a67344469d51d7f2d4a4d0338a45c1de261 Mon Sep 17 00:00:00 2001 From: Mike Alfare <13974384+mikealfare@users.noreply.github.com> Date: Wed, 18 Sep 2024 16:29:18 -0400 Subject: [PATCH] snowplow is deprecating track_struct_event; use StructuredEvent instead (#10736) --- core/dbt/tracking.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/core/dbt/tracking.py b/core/dbt/tracking.py index 0358b29f020..7d648d86e03 100644 --- a/core/dbt/tracking.py +++ b/core/dbt/tracking.py @@ -12,6 +12,7 @@ from snowplow_tracker import Emitter, SelfDescribingJson, Subject, Tracker from snowplow_tracker import __version__ as snowplow_version # type: ignore from snowplow_tracker import logger as sp_logger +from snowplow_tracker.events import StructuredEvent from dbt import version as dbt_version from dbt.adapters.exceptions import FailedToConnectError @@ -217,12 +218,12 @@ def get_dbt_env_context(): def track(user, *args, **kwargs): if user.do_not_track: return - else: - fire_event(SendingEvent(kwargs=str(kwargs))) - try: - tracker.track_struct_event(*args, **kwargs) - except Exception: - fire_event(SendEventFailure()) + + fire_event(SendingEvent(kwargs=str(kwargs))) + try: + tracker.track(StructuredEvent(*args, **kwargs)) + except Exception: + fire_event(SendEventFailure()) def track_project_id(options):