Skip to content
Snippets Groups Projects

Small adaptations to make swh.storage compatible with both swh.mode v6 and (future) v7

Merged David Douard requested to merge douardda/swh-storage:prepare-for-swh-model-v7 into master

Adapt the some SkippedContent handling pieces of code to make swh.storage compatible with both swh.model v6 (in which BaseContent.hashes() returns a generic dict which values can be None for SkippedContent) to future v7 (in which BaseContent.hashes() returns a ContentId typed dict).

To do so we:

  • Explicitly convert BaseContent.hashes() as dict,
  • fix test_replay (removal of funky length management in MultiHash),
  • adapt tests and one Postgresql storage method to make it compatible with ContentId (used to return a "total" dict which values can be None, it's now a non-total dict which values are byte).

This is needed to help a small swh.model (future) evolution that will make these methods return TypedDict instead of raw dicts.

A future revision will come to improve code annotations of skipped content methods once swh.model v7 is published.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading