-
Notifications
You must be signed in to change notification settings - Fork 94
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
Xtrigger function arg validation. #5452
Conversation
6548088
to
8a28af6
Compare
9643892
to
d921641
Compare
8a92221
to
f20559b
Compare
|
This conflicts/will conflict with #5831 which has been merged into master I created a temporary branch off master and merged in this branch - https://github.com/MetRonnie/cylc-flow/tree/xtrigger-tmp However, I get an error when using
May be worth changing milestone to master and sorting out the problem there? |
f20559b
to
d5bc789
Compare
Done. (This branch originally targeted master, not sure why we re-directed at some point) |
Redrafting this briefly - I've had to redo the arg validation bit for entry points. Done, but just checking the changes locally before pushing them up. |
This changes the If the loaded module contains a |
2538bcf
to
da37214
Compare
if kw != "offset": | ||
raise WorkflowConfigError(f"Illegal arg '{kw}': {f_signature}") | ||
|
||
elif n_args: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not convinced that this is safe - I think that it needs to be if not elif. I've had a go at writing integration tests for these, and I was going to write some unit tests too, but I've run out of time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's valid because of line 50. i.e. it has to be one or the other because the config file can only have (e.g.) wall_clock(PT1H)
or wall_clock(offset=PT1H)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that makes sense - I was projecting backward from the xrandom test where I started out with a copy of this.
Note on the new We decided to allow positional and keyword args in xtrigger config. E.g. these are equivalent:
Unfortunately this can make argument validation tricky (you may have to check both args and kwargs for a given item). |
I've made an additional check which I think is worth mentioning - I've scraped our local workflow run-dirs for |
Replaced by #5955 |
Close #5448
Targeting master not 8.1.x because this conflicts with #5291This is not just a bug-fix for the
wall_clock
xtrigger - I've gone for a generic approach:validate_config
it will be called at validation time, with the parsed args.Check List
CONTRIBUTING.md
and added my name as a Code Contributor.setup.cfg
(andconda-environment.yml
if present).CHANGES.md
entry included if this is a change that can affect users?.?.x
branch.