Skip to content

Commit

Permalink
snowplow is deprecating track_struct_event; use StructuredEvent inste…
Browse files Browse the repository at this point in the history
…ad (#10736)
  • Loading branch information
mikealfare authored Sep 18, 2024
1 parent 9e633f6 commit 3e437a6
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions core/dbt/tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 3e437a6

Please sign in to comment.