Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion admin/test/scripts/make_test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ def process_archive(input_file, all_patterns, filepath_list=None):
Args:
input_file (str): The path to the archive file.
all_patterns (dict): A dictionary where keys are artifact names and
values are lists of glob patterns.
values are a sequence of glob patterns, or a
single pattern string.
filepath_list (list, optional): A pre-compiled list of file paths
within the archive. Defaults to None.

Expand All @@ -272,6 +273,12 @@ def process_archive(input_file, all_patterns, filepath_list=None):
Raises:
ValueError: If the input file is not a supported archive format.
"""
# A single-pattern `paths` written without its trailing comma is a str, not a
# one-element tuple. Iterating it yields characters, and a leading '*' then
# matches every member of the archive. Normalize once here, the way
# match_files_from_list and the main loop already do.
all_patterns = {name: (patterns,) if isinstance(patterns, str) else patterns
for name, patterns in all_patterns.items()}
matching_files = defaultdict(list if filepath_list else dict)
file_count = 0
start_time = time.time()
Expand Down
Loading