Skip to content
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

DM-33174: Allow "@" in run collection names #627

Merged
merged 1 commit into from
Jan 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/lsst/daf/butler/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def globToRegex(
if not expressions or "*" in expressions:
return Ellipsis

nomagic = re.compile(r"^[\w/\.\-]+$", re.ASCII)
nomagic = re.compile(r"^[\w/\.\-@]+$", re.ASCII)

# Try not to convert simple string to a regex.
results: List[Union[str, Pattern]] = []
Expand Down
6 changes: 6 additions & 0 deletions tests/test_butler.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,12 @@ def testConstructor(self):
collections = set(butler.registry.queryCollections())
self.assertEqual(collections, {"ingest"})

# Check that some special characters can be included in run name.
special_run = "u@b.c-A"
butler_special = Butler(butler=butler, run=special_run)
collections = set(butler_special.registry.queryCollections("*@*"))
self.assertEqual(collections, {special_run})

butler2 = Butler(butler=butler, collections=["other"])
self.assertEqual(butler2.collections, CollectionSearch.fromExpression(["other"]))
self.assertIsNone(butler2.run)
Expand Down