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

Implement conditional requirement for required keys anywhere in the args spec #1165

Closed
phargogh opened this issue Jan 31, 2023 · 1 comment · Fixed by #1511
Closed

Implement conditional requirement for required keys anywhere in the args spec #1165

phargogh opened this issue Jan 31, 2023 · 1 comment · Fixed by #1511
Assignees
Labels
enhancement New feature or request in progress This issue is actively being worked on
Milestone

Comments

@phargogh
Copy link
Member

phargogh commented Jan 31, 2023

When writing out the MODEL_SPEC for UNA, I inadvertently wrote {"required": <expression>} for vector and CSV columns, forgetting that validation of conditional requirement wasn’t yet implemented. Here’s what I’m thinking for a solution:

  1. Create a copy of args where all the required keys (regardless of where it is in the nested dict) are checked for expressions. If an expression is found, evaluate it like we evaluate required keys at the top level. The result is bool values where the expressions were before.
  2. This new dict could be validated as we validate it now since we already check for required: True when validating individual inputs.

Related to #722
Needed for #1150

Estimated time remaining

To be safe (and to make sure this is tested), I'd guess this is several days of effort, maybe 1 week of development time.

@phargogh phargogh added enhancement New feature or request in progress This issue is actively being worked on labels Jan 31, 2023
@phargogh phargogh added this to the 3.13.0 milestone Jan 31, 2023
@phargogh phargogh self-assigned this Jan 31, 2023
@phargogh phargogh modified the milestones: 3.13.0, 3.13.1 Mar 3, 2023
@phargogh phargogh modified the milestones: 3.14.0, 3.15.0 Aug 24, 2023
@phargogh
Copy link
Member Author

Not quite anywhere in the args spec, but #1511 does implement conditional requirement for vector fields and for CSV columns and rows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request in progress This issue is actively being worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant