-
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
Assume task parameters with underscores to be strings. #6571
base: 8.4.x
Are you sure you want to change the base?
Conversation
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.
LGTM.
This could do with a changelog. We might want to put it on the 8.4.x branch as it's more of a fix than a feature.
>>> CylcConfigValidator.coerce_parameter_list('084_132', None) | ||
['084_132'] | ||
|
||
>>> CylcConfigValidator.coerce_parameter_list('072, a', None) |
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.
This Fixes a coverage hole.
@@ -699,7 +699,7 @@ def test_coerce_parameter_list(): | |||
('-15, -10, -5, -1..1', [-15, -10, -5, -1, 0, 1])]: | |||
assert validator.coerce_parameter_list(value, ['whatever']) == result | |||
# The bad | |||
for value in ['foo/bar', 'p1, 1..10', '2..3, 4, p']: | |||
for value in ['foo/bar', 'p1, 1..10', '2..3, 4, p', 'x:,']: |
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.
Fix a coverage hole.
PEP-515 allowed integers to be defined with underscores from python 3.6. This changes the behaviour of Cylc task parameters, as `"123_456"` can now be interpreted as an integer.
a18e896
to
fec1f3c
Compare
Co-authored-by: Oliver Sanders <[email protected]>
Co-authored-by: Ronnie Dutta <[email protected]>
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.
LGTM, tested, got 1 suggestion
Co-authored-by: Ronnie Dutta <[email protected]>
Summary
PEP-515 allowed integers to be defined with underscores from python 3.6.
This changes the behaviour of Cylc task parameters, as
"123_456"
can now be interpreted as an integer.n.b. I've tried to get 100% coverage on the method under test.
I'm going to have a quick play around with the code to ensure that we've not missed anything else about this change that needs addressing.
Bug reported on internal VivaEngage
(how to replicate)
Where one would expect
Check List
CONTRIBUTING.md
and added my name as a Code Contributor.setup.cfg
(andconda-environment.yml
if present).?.?.x
branch.