Page MenuHomeSoftware Heritage

Don't store empty metadata dicts.
ClosedPublic

Authored by vlorentz on Apr 3 2019, 11:27 AM.

Diff Detail

Repository
rDCIDX Metadata indexer
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

olasd added inline comments.
swh/indexer/metadata.py
307–308

This can be rewritten as if ref_item['metadata'].keys() <= {'@context'}

312–320

Couldn't we turn these into sets rather than doing O(n^2) equality lookups? (I'm guessing n is tiny and it doesn't really matter, but still :p)

swh/indexer/metadata.py
307–308

TIL

312–320

No, they contain unhashable data, and n is too small to do something clever.

Apply @olasd's comment

swh/indexer/metadata.py
307–308

(though I still have to check for Noneness)

douardda added a subscriber: douardda.

LGTM but I'm not very familiar with this code.

This revision is now accepted and ready to land.Apr 15 2019, 4:48 PM
This revision was landed with ongoing or failed builds.Apr 24 2019, 3:30 PM
This revision was automatically updated to reflect the committed changes.