Skip to content

Commit 80bf00d

Browse files
committed
bugfix(parse): Allow '-' in element names (fixes #3)
1 parent 3badba8 commit 80bf00d

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/lsst/cmservice/parsing/string.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ def parse_element_fullname(fullname: str) -> Fullname:
4848
fullname_r = re.compile(
4949
(
5050
r"^"
51-
r"(?P<campaign>[\w]+){1}(?:\/)*"
52-
r"(?P<step>[\w]+){0,1}(?:\/)*"
53-
r"(?P<group>[\w]+){0,1}(?:\/)*"
54-
r"(?P<job>[\w]+){0,1}(?:\/)*"
55-
r"(?P<script>[\w]+){0,1}"
51+
r"(?P<campaign>[\w-]+){1}(?:\/)*"
52+
r"(?P<step>[\w-]+){0,1}(?:\/)*"
53+
r"(?P<group>[\w-]+){0,1}(?:\/)*"
54+
r"(?P<job>[\w-]+){0,1}(?:\/)*"
55+
r"(?P<script>[\w-]+){0,1}"
5656
r"$"
5757
),
5858
re.MULTILINE,

tests/test_parsing.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
("campaign_name/step_name/group0", "group"),
1212
("campaign_name/step_name", "step"),
1313
("campaign_name", "campaign"),
14+
("campaign-name", "campaign"),
1415
],
1516
)
1617
def test_fullname_parsing(fullname: str, expected: str) -> None:

0 commit comments

Comments
 (0)