pitrou commented on code in PR #14456:
URL: https://github.com/apache/arrow/pull/14456#discussion_r999423244


##########
dev/archery/archery/crossbow/core.py:
##########
@@ -1185,34 +1185,49 @@ def select(self, tasks=None, groups=None):
                     "Unable to match any tasks for `{}`".format(pattern)
                 )
 
-        requested_group_tasks = set()
-        for group in group_allowlist:
-            # separate the patterns from the blocklist patterns
-            task_patterns = list(config_groups[group])
-            task_blocklist_patterns = [
-                x.strip("~") for x in task_patterns if x.startswith("~")]
-            task_patterns = [x for x in task_patterns if not x.startswith("~")]
-
-            # treat the task names as glob patterns to select tasks more easily
-            for pattern in task_patterns:
-                matches = fnmatch.filter(valid_tasks, pattern)
-                if len(matches):
-                    requested_group_tasks.update(matches)
-                else:
+        def resolve_group(group):
+            group_tasks = set()
+            patterns = list(config_groups[group])
+            blocklist_patterns = [
+                x.strip("~") for x in patterns if x.startswith("~")]
+            patterns = [x for x in patterns if not x.startswith("~")]
+
+            # treat the task/group names as glob patterns to select
+            # tasks/groups more easily
+            for pattern in patterns:
+                matched_tasks = fnmatch.filter(valid_tasks, pattern)
+                matched_groups = fnmatch.filter(valid_groups, pattern)
+                matched_groups = set(matched_groups).difference([group])
+                if len(matched_tasks) == 0 and len(matched_groups) == 0:
                     raise CrossbowError(
-                        "Unable to match any tasks for `{}`".format(pattern)
+                        "Unable to match any tasks/groups for `{}`".format(
+                            pattern)

Review Comment:
   Can use f-strings nowadays
   ```suggestion
                           f"Unable to match any tasks/groups for `{pattern}`"
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to