diff --git a/doc/changes/DM-54319.bugfix.md b/doc/changes/DM-54319.bugfix.md new file mode 100644 index 000000000..54f2053a6 --- /dev/null +++ b/doc/changes/DM-54319.bugfix.md @@ -0,0 +1 @@ +Fixed - not being able to be in a name specified in PipelineGraph select. diff --git a/python/lsst/pipe/base/pipeline_graph/expressions.py b/python/lsst/pipe/base/pipeline_graph/expressions.py index aeac73da5..016eb51b4 100644 --- a/python/lsst/pipe/base/pipeline_graph/expressions.py +++ b/python/lsst/pipe/base/pipeline_graph/expressions.py @@ -84,7 +84,7 @@ def make_lexer(cls) -> Any: # unspecified PLY type. # Identifiers are alphanumeric, and may have a T:, D:, or S: prefix. def t_IDENTIFIER(self, t: LexToken) -> LexToken: - r"""([TDS]:)?\w+""" + r"""([TDS]:)?[\w-]+""" t.type = "IDENTIFIER" return t diff --git a/tests/test_pipeline_graph_expressions.py b/tests/test_pipeline_graph_expressions.py index ad38e3fdb..40c12504d 100644 --- a/tests/test_pipeline_graph_expressions.py +++ b/tests/test_pipeline_graph_expressions.py @@ -44,7 +44,7 @@ def test_identifiers(self): self.assertEqual(pge.parse("D:c_4"), pge.IdentifierNode(qualifier="D", label="c_4")) self.assertEqual(pge.parse("S:d_5"), pge.IdentifierNode(qualifier="S", label="d_5")) with self.assertRaises(InvalidExpressionError): - pge.parse("a-3") + pge.parse("a+3") with self.assertRaises(InvalidExpressionError): pge.parse("G:d1")