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

feat(ingest): replace base85's pickle with json #6178

Merged
merged 3 commits into from Oct 14, 2022

Conversation

hsheth2
Copy link
Collaborator

@hsheth2 hsheth2 commented Oct 12, 2022

The previous base85 implementation used pickle to serialize and deserialize state. This would throw an error if the state model ever changed. See this SO answer for context on pickle's lack of backwards compatibility: https://stackoverflow.com/questions/64894061/renaming-python-package-with-backwards-compatibility-for-pickle.

Other benefits:

  • Pickle allows arbitrary code execution which is a pretty unexpected attack vector, so it'd be good to get rid of it.
  • Using base85 + bz2 + JSON is actually smaller than base85 + bz2 + pickle.

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

The previous base85 implementation used pickle to serialize and
deserialize state. This would cause issues if the state model ever
changed.
@github-actions github-actions bot added the ingestion PR or Issue related to the ingestion of metadata label Oct 12, 2022
@github-actions
Copy link

github-actions bot commented Oct 12, 2022

Unit Test Results (metadata ingestion)

       8 files         8 suites   56m 43s ⏱️
   735 tests    733 ✔️ 2 💤 0
1 472 runs  1 468 ✔️ 4 💤 0

Results for commit 2cb9c05.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Oct 12, 2022

Unit Test Results (build & test)

597 tests  ±0   593 ✔️ ±0   11m 40s ⏱️ -15s
147 suites ±0       4 💤 ±0 
147 files   ±0       0 ±0 

Results for commit 2cb9c05. ± Comparison against base commit c0d42de.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@shirshanka shirshanka left a comment

Choose a reason for hiding this comment

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

LGTM!

@hsheth2 hsheth2 merged commit d08f5f7 into datahub-project:master Oct 14, 2022
@hsheth2 hsheth2 deleted the pickle-state branch October 14, 2022 21:48
anthonyhungnguyen pushed a commit to anthonyhungnguyen/zlp-datahub that referenced this pull request Nov 8, 2022
cccs-tom pushed a commit to CybercentreCanada/datahub that referenced this pull request Nov 18, 2022
cccs-tom pushed a commit to CybercentreCanada/datahub that referenced this pull request Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ingestion PR or Issue related to the ingestion of metadata
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants