Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

Add version module and add version to tracking #327

Merged
merged 2 commits into from
Dec 2, 2022
Merged

Conversation

kylemcnair
Copy link
Contributor

Summary

The primary objective of this PR is to add data-diff version to tracking.

Detail / version module

However, when importing the __version__ variable in the tracking.py module, I ran into circular import errors. Circular references seemed to be related to imports in __init__.py, __main__.py, and tracking.py. Both __init__.py and __main__.py import tracking via from .tracking import disable_tracking.

Errors were all some version of:

Error while finding module specification for 'data_diff.__main__' (ImportError: cannot import name '__version__' from partially initialized module 'data_diff' (most likely due to a circular import)

Rather than trying to disentangle the circular imports, I simply created a version.py module, and parked the __version__ variable there.

Happy to revise this if there's a better path, or if I misunderstood errors. please let me know.

List of changes

  • add version.py module with __version__
  • remove __version__ from __init__.py
  • revise __main__.py to use from .version import __version__
  • add __version__ to track events

Event validation in Snowflake

Version is successfully coming through Rudderstack events
Screen Shot 2022-12-01 at 4 58 35 PM

select sent_at::date,data_diff_version,*
from "RUDDERSTACK_EVENTS"."OS_DATA_DIFF_PROD"."OS_DIFF_RUN_END"
where context_ip = '98.182.17.95'
order by 1 desc
limit 10

Python formatting

Formatting:

data-diff [version-tracking] black data_diff/tracking.py data_diff/version.py
All done! ✨ 🍰 ✨
2 files left unchanged.

@kylemcnair kylemcnair self-assigned this Dec 2, 2022
@erezsh erezsh merged commit b6b4618 into master Dec 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants