Skip to content

Commit 278a387

Browse files
authored
Release 0.0.44 (#280)
* Add continuation token to for liststatus * Updated history and version
1 parent 096c146 commit 278a387

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

HISTORY.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
Release History
44
===============
55

6+
0.0.44 (2019-03-05)
7+
+++++++++++++++++++
8+
* Add continuation token to LISTSTATUS api call
9+
* Update api-version to 2018-09-01
10+
611
0.0.43 (2019-03-01)
712
+++++++++++++++++++
813
* Fix bug in downloader when glob returns a single file

azure/datalake/store/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# license information.
77
# --------------------------------------------------------------------------
88

9-
__version__ = "0.0.43"
9+
__version__ = "0.0.44"
1010

1111
from .core import AzureDLFileSystem
1212
from .multithread import ADLDownloader

azure/datalake/store/core.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class AzureDLFileSystem(object):
5353
url_suffix: str (None)
5454
Domain to send REST requests to. The end-point URL is constructed
5555
using this and the store_name. If None, use default.
56-
api_version: str (2018-05-01)
56+
api_version: str (2018-09-01)
5757
The API version to target with requests. Changing this value will
5858
change the behavior of the requests, and can cause unexpected behavior or
5959
breaking changes. Changes to this value should be undergone with caution.
@@ -118,14 +118,16 @@ def _ls_batched(self, path, batch_size=4000):
118118
raise ValueError("Batch size must be strictly greater than 1")
119119
parms = {'listSize': batch_size}
120120
ret = []
121-
data = [None]
121+
continuation_token = "NonEmptyStringSentinel"
122122

123-
while data:
124-
data = self.azure.call('LISTSTATUS', path, **parms)['FileStatuses']['FileStatus']
123+
while continuation_token != "":
124+
ls_call_result = self.azure.call('LISTSTATUS', path, **parms)
125+
126+
data = ls_call_result['FileStatuses']['FileStatus']
125127
ret.extend(data)
126-
if len(data) < batch_size:
127-
break
128-
parms['listAfter'] = ret[-1]['pathSuffix'] # Last path to be used as ListAfter
128+
129+
continuation_token = ls_call_result['FileStatuses']['continuationToken']
130+
parms['listAfter'] = continuation_token # continuationToken to be used as ListAfter
129131

130132
return ret
131133

azure/datalake/store/lib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ class DatalakeRESTInterface:
221221
url_suffix: str (None)
222222
Domain to send REST requests to. The end-point URL is constructed
223223
using this and the store_name. If None, use default.
224-
api_version: str (2018-05-01)
224+
api_version: str (2018-09-01)
225225
The API version to target with requests. Changing this value will
226226
change the behavior of the requests, and can cause unexpected behavior or
227227
breaking changes. Changes to this value should be undergone with caution.
@@ -256,7 +256,7 @@ class DatalakeRESTInterface:
256256
}
257257

258258
def __init__(self, store_name=default_store, token=None,
259-
url_suffix=default_adls_suffix, api_version='2018-05-01', **kwargs):
259+
url_suffix=default_adls_suffix, api_version='2018-09-01', **kwargs):
260260
# in the case where an empty string is passed for the url suffix, it must be replaced with the default.
261261
url_suffix = url_suffix or default_adls_suffix
262262
self.local = threading.local()

0 commit comments

Comments
 (0)