@@ -55,13 +55,16 @@ def test_split_wildcard_path():
5555
5656
5757def test_match_wildcard ():
58- """Test wildcard pattern matching"""
59- # Asterisk matches multiple characters
58+ """Test wildcard pattern matching with glob-like semantics """
59+ # Asterisk matches multiple characters (but not path separators)
6060 assert paths .match_wildcard ("bucket/path/*.parquet" , "bucket/path/file1.parquet" ) is True
6161 assert paths .match_wildcard ("bucket/path/*.parquet" , "bucket/path/file2.parquet" ) is True
6262 assert paths .match_wildcard ("bucket/path/*.parquet" , "bucket/path/data.csv" ) is False
6363
64- # Question mark matches single character
64+ # Asterisk does NOT match across directory boundaries (glob-like behavior)
65+ assert paths .match_wildcard ("bucket/path/*.parquet" , "bucket/path/subdir/file.parquet" ) is False
66+
67+ # Question mark matches single character (but not path separators)
6568 assert paths .match_wildcard ("bucket/path/file?.parquet" , "bucket/path/file1.parquet" ) is True
6669 assert paths .match_wildcard ("bucket/path/file?.parquet" , "bucket/path/file2.parquet" ) is True
6770 assert paths .match_wildcard ("bucket/path/file?.parquet" , "bucket/path/file10.parquet" ) is False
@@ -71,6 +74,10 @@ def test_match_wildcard():
7174 assert paths .match_wildcard ("bucket/path/file[0-9].parquet" , "bucket/path/file5.parquet" ) is True
7275 assert paths .match_wildcard ("bucket/path/file[0-9].parquet" , "bucket/path/fileA.parquet" ) is False
7376
77+ # Wildcard in middle of path
78+ assert paths .match_wildcard ("bucket/*/data.parquet" , "bucket/subdir/data.parquet" ) is True
79+ assert paths .match_wildcard ("bucket/*/data.parquet" , "bucket/a/b/data.parquet" ) is False
80+
7481 # No wildcards - exact match
7582 assert paths .match_wildcard ("bucket/path/data.parquet" , "bucket/path/data.parquet" ) is True
7683 assert paths .match_wildcard ("bucket/path/data.parquet" , "bucket/path/other.parquet" ) is False
0 commit comments