Skip to content

Allow Custom File Systems To Override The Walk Method #6902

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 6 additions & 0 deletions tensorboard/compat/tensorflow_stub/io/gfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,12 @@ def walk(top, topdown=True, onerror=None):
"""
top = compat.as_str_any(top)
fs = get_filesystem(top)

if hasattr(fs, "walk"):
for item in fs.walk(top, topdown=topdown, onerror=onerror):
yield item
return

try:
listing = listdir(top)
except errors.NotFoundError as err:
Expand Down