Skip to content

Commit

Permalink
snowplow is deprecating track_struct_event; use StructuredEvent instead
Browse files Browse the repository at this point in the history
  • Loading branch information
mikealfare committed Sep 18, 2024
1 parent 054c6fd commit ea4f0ef
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 @@ -215,12 +216,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())

Check warning on line 224 in core/dbt/tracking.py

View check run for this annotation

Codecov / codecov/patch

core/dbt/tracking.py#L223-L224

Added lines #L223 - L224 were not covered by tests


def track_project_id(options):
Expand Down

0 comments on commit ea4f0ef

Please sign in to comment.