You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: [Python] LocalFileSystem.match() returns empty results for relative glob patterns in the current working directory #41375
Calling FileSystems.match(['users.json*']) (or FileSystems.delete(['users.json*']) / fileio.MatchFiles('users.json*')) with a bare relative glob pattern in the current working directory (no directory separator) returns 0 matches even when matching files exist in os.getcwd(), whereas FileSystems.match(['./users.json*']) succeeds:
In FileSystem.match (sdks/python/apache_beam/io/filesystem.py, lines 742-759) and LocalFileSystem (sdks/python/apache_beam/io/localfilesystem.py, lines 87-125):
For pattern = 'users.json*', prefix_or_dir is 'users.json'.
LocalFileSystem._list('') checks if not self.exists(dir_or_prefix): return (localfilesystem.py:113-114). Because os.path.exists('') is False, _list('') yields nothing.
Note that if _list walks '.' when dir_or_prefix == '', the leading './' (or '.\' on Windows) prefix on yielded paths also needs to be stripped so self.match_files(file_metadatas, 'users.json*') matches the caller's relative pattern cleanly.
Issue Priority
Priority: 2 (default / most bugs should be filed as P2)
Activity
Naman-Katiyar commentedon Nov 16, 2026
.take-issue
Hi, I would like to work on this issue. Could you please assign it to me?
shikhabhadoria commentedon Nov 16, 2026
.take-issue
[Python] Fix LocalFileSystem.match() for relative globs in cwd (#41375)…