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

Fix pytest warnings: exemplars not matching schemas #1208

Open
tinatn29 opened this issue Dec 11, 2024 · 7 comments
Open

Fix pytest warnings: exemplars not matching schemas #1208

tinatn29 opened this issue Dec 11, 2024 · 7 comments

Comments

@tinatn29
Copy link
Contributor

tinatn29 commented Dec 11, 2024

Problem

Schema-related warnings when running pytest:

src/regolith/tests/test_validate.py::test_validate_python
src/regolith/tests/test_validate.py::test_validate_bad_python
src/regolith/tests/test_validators.py::test_validation[grants]
src/regolith/tests/test_validators.py::test_exemplars[grants]
/Users/Baitong/My Drive/BGPostdoc/regolith/regolith/src/regolith/schemas.py:187: UserWarning: "researcher" is not in the preferred entries for "position", please consider changing this entry to conform or add this to the eallowed field in the schema.
warn(

src/regolith/tests/test_validate.py::test_validate_python
/Users/Baitong/My Drive/BGPostdoc/regolith/regolith/src/regolith/schemas.py:187: UserWarning: "" is not in the preferred entries for "recommendation", please consider changing this entry to conform or add this to the eallowed field in the schema.
warn(

src/regolith/tests/test_validate.py::test_validate_python
src/regolith/tests/test_validate.py::test_validate_bad_python
src/regolith/tests/test_validators.py::test_validation[expenses]
src/regolith/tests/test_validators.py::test_exemplars[expenses]
/Users/Baitong/My Drive/BGPostdoc/regolith/regolith/src/regolith/schemas.py:187: UserWarning: "bad_status" is not in the preferred entries for "status", please consider changing this entry to conform or add this to the eallowed field in the schema.
warn(

src/regolith/tests/test_validate.py::test_validate_python
src/regolith/tests/test_validate.py::test_validate_bad_python
src/regolith/tests/test_validators.py::test_validation[people]
src/regolith/tests/test_validators.py::test_exemplars[people]
/Users/Baitong/My Drive/BGPostdoc/regolith/regolith/src/regolith/schemas.py:187: UserWarning: "janitor" is not in the preferred entries for "position", please consider changing this entry to conform or add this to the eallowed field in the schema.
warn(

Proposed solution

Edit the schema to match or edit the entry in exemplars.json? We wonder if some of these might have been "wrong" entries by design to test the warnings... (e.g. our schemas may not need to include "bad_status" or "janitor")

@tinatn29
Copy link
Contributor Author

@sbillinge these warnings show entries that do not match the schemas^, do we edit the schemas to match? A number of these look like test cases that were designed to trigger the warnings?

@bobleesj
Copy link
Contributor

bobleesj commented Dec 11, 2024

@tinatn29 a quick question, do all warnings originate from this unseen keys in the schema ?

@tinatn29
Copy link
Contributor Author

tinatn29 commented Dec 11, 2024

@bobleesj the first (top) two warning messages are different: Data Validation extension not supported and Unknown extension not supported, but I don't know what they mean... (ah sorry should've made this a separate issue!)

@bobleesj
Copy link
Contributor

Yes, if you could make separate issues for those, that would be good. So that our PRs become modular.

@bobleesj
Copy link
Contributor

A title sth along the line of Fix 17 out of xx pytest warnings - data schema key ... blah blah blah

@tinatn29 tinatn29 changed the title Fix pytest the remaining 17 warnings Fix pytest warnings: schemas Dec 11, 2024
@tinatn29 tinatn29 changed the title Fix pytest warnings: schemas Fix 17 pytest warnings: exemplars not matching schemas Dec 11, 2024
@tinatn29 tinatn29 changed the title Fix 17 pytest warnings: exemplars not matching schemas Fix pytest warnings: exemplars not matching schemas Dec 11, 2024
@tinatn29
Copy link
Contributor Author

ok! edited this one and will create another one for the other warnings. It will fix < 17 warnings because some of them are the different warnings 😅 so I left the number out for now

@sbillinge
Copy link
Contributor

I fixed most of the schema issues. Some that were left may have been coming from the tests. I will have to look. Don't spend too much time on these schema warnings until I look at them.

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

No branches or pull requests

3 participants