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

Warn when unexpected keys in specs #1134

Merged
merged 3 commits into from
Jul 1, 2024
Merged

Warn when unexpected keys in specs #1134

merged 3 commits into from
Jul 1, 2024

Conversation

rly
Copy link
Contributor

@rly rly commented Jun 27, 2024

Motivation

In a few separate instances, users have tried to create an extension with a group, dataset, or link with "required: true" or an attribute with "quantity: '?'" (I'm not 100% sure on this latter one but definitely the former one). The extension template now warns if the yaml fails schema validation. It would be useful to do this in the API as well. Right now, extra args to the spec constructors are ignored. This PR warns when reading a spec with extra args. We could make this an error, but I worry about breaking the reading of existing data with extensions that have extra args.

Ref: catalystneuro/ndx-patterned-ogen#15 (comment)

Checklist

  • Did you update CHANGELOG.md with your changes?
  • Does the PR clearly describe the problem and the solution?
  • Have you reviewed our Contributing Guide?
  • Does the PR use "Fix #XXX" notation to tell GitHub to close the relevant issue numbered XXX when the PR is merged?

@rly rly requested a review from bendichter June 27, 2024 00:45
Copy link

codecov bot commented Jun 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.78%. Comparing base (539ecf4) to head (492e061).
Report is 27 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #1134   +/-   ##
=======================================
  Coverage   88.78%   88.78%           
=======================================
  Files          45       45           
  Lines        9778     9782    +4     
  Branches     2777     2778    +1     
=======================================
+ Hits         8681     8685    +4     
  Misses        780      780           
  Partials      317      317           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rly rly requested a review from mavaylon1 June 28, 2024 20:43
@rly rly merged commit 5e13d64 into dev Jul 1, 2024
29 checks passed
@rly rly deleted the warn_extra_args_spec branch July 1, 2024 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants