-
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
Inheritance parsing - ignoring items if not all quoted #2700
Comments
Does it work if you don't quote anything? |
You can't actually get that past validation as that errors with: [FAIL] ERROR: names containing commas must be quoted (e.g. 'foo<m,n>') |
Potentially anticipating your next question, you also can't do (which is closer to my real use-case rather than the simplified one above): 'MAINFAM<major, minor>, SOMEFAM' as it only expands out the first MAINFAM item but not the SOMEFAM one (still reads it as |
Further experimenting also shows an issue with:
albeit in the same entry now! @matthewrmshin - would you like me to capture that in a separate issue or just leave it in here as the two are (presumably) inter-related? |
The problem is in the Follow Pythex link to see that the match finds The naive solution, I think, would be to just add more to that regex and increase its complexity, but thus allowing it to find matches of single-quoted, plus non-quoted values. But then the issue would be whether mixing quotes would be OK too. i.e., is this valid?
Unit test to reproduce the issue: import unittest
import tempfile
from cylc.config import SuiteConfig
class TestConfig(unittest.TestCase):
def test_inheritance(self):
template_vars = {}
with tempfile.NamedTemporaryFile() as tf:
tf.write("""
[scheduling]
[[dependencies]]
graph = '''hello => BYE
hello => CIAO
'''
[runtime]
[[hello]]
[[BYE]]
[[CIAO]]
[[ goodbye_0 ]]
inherit = 'BYE', CIAO
""")
tf.flush()
config = SuiteConfig('test', tf.name, template_vars=template_vars)
self.assertTrue('goodbye_0'
in config.runtime['descendants']['BYE'])
self.assertTrue('goodbye_0'
in config.runtime['descendants']['CIAO']) It will fail in the last |
Bit of a weird one - only hit it because of working with parameterization.
Have written task inheritance in two ways. In the first, the non-quoted item doesn't get picked up:
inherit = 'MAINFAM<major, minor>', SOMEFAM
Whereas when each item is quoted in the list the do all get picked up:
inherit = 'MAINFAM<major, minor>', 'SOMEFAM'
Had to put MAINFAM, in quotes because of the need to (according to validation) with two items to iterate over - presumably to identify it as a single item. You can replicate this behavior with non-parameter based inheritance though (although it would be odd to quote an item if you didn't need to for parameterization):
inherit = 'BIGFAM', SOMEFAM
Depending on the rest of your suite graphing and runtime you may or may not miss that the SOMEFAM type entry gets missed.
The text was updated successfully, but these errors were encountered: