Page MenuHomeSoftware Heritage

Add a --type option to the `swh dataset graph export` command
ClosedPublic

Authored by douardda on Apr 15 2022, 12:28 PM.

Details

Summary

to easily set the list of exported object types. If not set, export all
supported object types.

Note that `--exclude` is also applied.

Diff Detail

Repository
rDDATASET Datasets
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build is green

Patch application report for D7588 (id=27475)

Rebasing onto 9f342d9994...

Current branch diff-target is up to date.
Changes applied before test
commit 6f6b1bd42760203427d2b8f72a6fd22d4686b106
Author: David Douard <david.douard@sdfa3.org>
Date:   Fri Apr 15 12:19:17 2022 +0200

    Add a --type option to the `swh dataset graph export` command
    
    to easily set the list of exported object types. If not set, export all
    supported object types.
    
    Note that ``--exclude`` is also applied.

See https://jenkins.softwareheritage.org/job/DDATASET/job/tests-on-diff/130/ for more details.

vlorentz added inline comments.
swh/dataset/cli.py
80

You should either:

  • rename it --types
  • make it an additive option (ie. with multiple=True) instead of comma-separated
99–102

Build is green

Patch application report for D7588 (id=27568)

Rebasing onto 9f342d9994...

Current branch diff-target is up to date.
Changes applied before test
commit 4154d43a4c55c20df7f37466f84adba3c1505c64
Author: David Douard <david.douard@sdfa3.org>
Date:   Fri Apr 15 12:19:17 2022 +0200

    Add a --types option to the `swh dataset graph export` command
    
    to easily set the list of exported object types. If not set, export all
    supported object types.
    
    Note that ``--exclude`` is also applied.

See https://jenkins.softwareheritage.org/job/DDATASET/job/tests-on-diff/134/ for more details.

This revision is now accepted and ready to land.Apr 21 2022, 9:55 AM
swh/dataset/cli.py
80

I thought about using multiple=True, but comma-separated is consistent with --exclude, so ...
But --types then make sense, indeed.