Skip to content

Commit

Permalink
[ABFS] Fix the ABFS filebrowser listing limit (#3500)
Browse files Browse the repository at this point in the history
  • Loading branch information
agl29 authored Oct 13, 2023
1 parent aac3643 commit 490c154
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions desktop/libs/azure/src/azure/abfs/abfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,19 @@ def listdir_stats(self, path, params=None, **kwargs):
if directory_name != "":
params['directory'] = directory_name

res = self._root._invoke("GET", file_system, params, headers=self._getheaders(), **kwargs)
resp = self._root._format_response(res)

if account != '':
file_system = file_system + account
for x in resp['paths']:
dir_stats.append(ABFSStat.for_directory(res.headers, x, root + file_system + "/" + x['name']))
while True:
res = self._root._invoke("GET", file_system, params, headers=self._getheaders(), **kwargs)
resp = self._root._format_response(res)
if account:
file_system += account
for x in resp['paths']:
dir_stats.append(ABFSStat.for_directory(res.headers, x, root + file_system + "/" + x['name']))
# If the number of paths returned exceeds the 5000, a continuation token is provided in the response header x-ms-continuation,
# which must be used in subsequent invocations to continue listing the paths.
if 'x-ms-continuation' in res.headers:
params['continuation'] = res.headers['x-ms-continuation']
else:
break

return dir_stats

Expand Down

0 comments on commit 490c154

Please sign in to comment.