Skip to content

ENH: minor tune up of addurls to be more tollerant and "informative"#7388

Merged
yarikoptic merged 3 commits into
datalad:maintfrom
yarikoptic:enh-addurls
Jun 8, 2023
Merged

ENH: minor tune up of addurls to be more tollerant and "informative"#7388
yarikoptic merged 3 commits into
datalad:maintfrom
yarikoptic:enh-addurls

Conversation

@yarikoptic

Copy link
Copy Markdown
Member

I was trying addurls on a file from https://gpt4all.io/models/models.json .

First

datalad  addurls -t json --key 'et:MD5-s{size}--{md5sum}' models.json 'https://gpt4all.io/models/{filename}' '{filename}'

was just crashing since not all records have some fields. I could have excluded them using -x regex, but I thought it would be suboptimal since that would result in not recording some metadata. So I decided just to issue a warning and proceed adding all other fields which have metadata present.

Then, surprisingly the --key simply had no effect and no warning of any kind was issued. It was since I used size instead of filesize. DEBUG level message was likely there but IMHO it is too much of a user mistake to just silently ignore since IMHO it is most likely a misspecification of the --key. So I decided to issue a warning there too. And I did not really see the point for CapturedException there, so removed that part.

@yarikoptic yarikoptic added the UX user experience label May 15, 2023
@codecov

codecov Bot commented May 15, 2023

Copy link
Copy Markdown

Codecov Report

Patch coverage: 75.00% and project coverage change: +70.13 🎉

Comparison is base (ce927ff) 20.56% compared to head (7dcec87) 90.70%.

❗ Current head 7dcec87 differs from pull request most recent head d2b82ea. Consider uploading reports for the commit d2b82ea to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##            maint    #7388       +/-   ##
===========================================
+ Coverage   20.56%   90.70%   +70.13%     
===========================================
  Files         327      327               
  Lines       44163    44691      +528     
  Branches        0     5922     +5922     
===========================================
+ Hits         9084    40537    +31453     
+ Misses      35079     4138    -30941     
- Partials        0       16       +16     
Impacted Files Coverage Δ
datalad/local/addurls.py 94.68% <75.00%> (+79.76%) ⬆️

... and 282 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@yarikoptic yarikoptic added semver-patch Increment the patch version when merged CHANGELOG-missing When a PR's description does not contain a changelog item, yet. labels May 16, 2023
@github-actions github-actions Bot removed the CHANGELOG-missing When a PR's description does not contain a changelog item, yet. label May 16, 2023
@yarikoptic

Copy link
Copy Markdown
Member Author

@mih please chime in.

yarikoptic and others added 3 commits June 2, 2023 22:39
…ta fields

Use case is the https://gpt4all.io/models/models.json  where two keys are used
only in a few records.  We can exclude them for all but I thought it would then
would effectively loose metadata.  An alternative is to provide an alternative
value e.g. "n/a" so may be worth an option?
ATM it would just silently proceed and then end up downloading possibly huge
files without providing user an alert of some kind that some fields he/she
entered are not present.  IMHO it is better to make it more explicit than to
require digging through DEBUG

@adswa adswa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks good to me

@yarikoptic
yarikoptic merged commit cd384e4 into datalad:maint Jun 8, 2023
@yarikoptic-gitmate

Copy link
Copy Markdown
Collaborator

PR released in 0.18.5

@yarikoptic
yarikoptic deleted the enh-addurls branch February 2, 2024 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver-patch Increment the patch version when merged UX user experience

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants