Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix conflict with newer versions of Snowplow tracker #9680

Merged
merged 6 commits into from
Apr 15, 2024
Merged

Fix conflict with newer versions of Snowplow tracker #9680

merged 6 commits into from
Apr 15, 2024

Conversation

edgarrmondragon
Copy link
Contributor

@edgarrmondragon edgarrmondragon commented Feb 27, 2024

resolves #8719, supersedes #9528

Problem

Instaling dbt-core with meltano in the same virtualenv breaks dbt because contract conflict between minimal-snowplow-tracker (dependency of dbt) and snowplow-python-tracker.

Solution

Adds explicit version check and use minimal or full contract call.

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX
  • This PR includes type annotations for new and modified functions

Based on #8680, by @akurdyukov.

@cla-bot cla-bot bot added the cla:yes label Feb 27, 2024
@edgarrmondragon edgarrmondragon changed the title Merge branch 'main' into fix/snowplow-tracker-conflict Fix conflict with newer versions of Snowplow tracker Feb 27, 2024
@edgarrmondragon
Copy link
Contributor Author

edgarrmondragon commented Feb 27, 2024

This should solve errors like this one when installing dbt followed by Meltano in the same environment:

$ python -c 'from dbt.tracking import tracker'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/me/contrib/dbt-core/core/dbt/tracking.py", line 105, in <module>
    emitter = TimeoutEmitter()
              ^^^^^^^^^^^^^^^^
  File "/Users/me/contrib/dbt-core/core/dbt/tracking.py", line 55, in __init__
    super().__init__(
TypeError: Emitter.__init__() got an unexpected keyword argument 'buffer_size'

And I can confirm that installing dbt with this patch and then Meltano, that command executes without error.


Note that this doesn't solve the issues that come from installing Meltano followed by dbt:

$ python -c 'from meltano.core.tracking.tracker import Tracker'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/me/meltano/meltano/src/meltano/core/tracking/__init__.py", line 5, in <module>
    from meltano.core.tracking.tracker import BlockEvents, Tracker
  File "/Users/me/meltano/meltano/src/meltano/core/tracking/tracker.py", line 21, in <module>
    from snowplow_tracker import Emitter, SelfDescribing, SelfDescribingJson
ImportError: cannot import name 'SelfDescribing' from 'snowplow_tracker' (/Users/me/meltano/meltano-dbt/venv/lib/python3.11/site-packages/snowplow_tracker/__init__.py)

but that should be covered by meltano/meltano#8256 or a derivative.

@edgarrmondragon edgarrmondragon marked this pull request as ready for review February 27, 2024 04:58
@edgarrmondragon edgarrmondragon requested a review from a team as a code owner February 27, 2024 04:58
@dbeatty10 dbeatty10 added the ready_for_review Externally contributed PR has functional approval, ready for code review from Core engineering label Feb 27, 2024
Copy link

codecov bot commented Feb 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.02%. Comparing base (7329143) to head (8936404).
Report is 37 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9680      +/-   ##
==========================================
- Coverage   88.06%   88.02%   -0.05%     
==========================================
  Files         178      178              
  Lines       22375    22379       +4     
==========================================
- Hits        19705    19698       -7     
- Misses       2670     2681      +11     
Flag Coverage Δ
integration 85.47% <100.00%> (-0.13%) ⬇️
unit 62.16% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ebnermic
Copy link

ebnermic commented Apr 3, 2024

Hi, I am waiting for this issue to be fixed as it blocks me. Is this going to be merged soon?
And thanks @edgarrmondragon for this PR!

Copy link
Member

@aranke aranke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for fixing @edgarrmondragon!

@aranke aranke merged commit 7e164e3 into dbt-labs:main Apr 15, 2024
65 checks passed
@edgarrmondragon edgarrmondragon deleted the snowplow-tracker-conflict branch April 15, 2024 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes community This PR is from a community member ready_for_review Externally contributed PR has functional approval, ready for code review from Core engineering
Projects
None yet
5 participants