Skip to content

Commit a29a80f

Browse files
committed
Update more collections module occurrences
1 parent df4f7a3 commit a29a80f

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

scrapinghub/client/collections.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import absolute_import
2-
import collections
32

43
from six import string_types
4+
from six.moves import collections_abc
55

66
from ..hubstorage.collectionsrt import Collection as _Collection
77

@@ -82,7 +82,7 @@ def iter(self):
8282
8383
:return: an iterator over collections list where each collection is
8484
represented by a dictionary with ('name','type') fields.
85-
:rtype: :class:`collections.Iterable[dict]`
85+
:rtype: :class:`collections.abc.Iterable[dict]`
8686
"""
8787
return self._origin.apiget('list')
8888

@@ -130,9 +130,9 @@ class Collection(object):
130130
>>> for elem in foo_store.iter(count=1)):
131131
... print(elem)
132132
[{'_key': '002d050ee3ff6192dcbecc4e4b4457d7', 'value': '1447221694537'}]
133-
133+
134134
- get generator over item keys::
135-
135+
136136
>>> keys = foo_store.iter(nodata=True, meta=["_key"]))
137137
>>> next(keys)
138138
{'_key': '002d050ee3ff6192dcbecc4e4b4457d7'}
@@ -185,7 +185,7 @@ def delete(self, keys):
185185
The method returns ``None`` (original method returns an empty generator).
186186
"""
187187
if (not isinstance(keys, string_types) and
188-
not isinstance(keys, collections.Iterable)):
188+
not isinstance(keys, collections_abc.Iterable)):
189189
raise ValueError("You should provide string key or iterable "
190190
"object providing string keys")
191191
self._origin.delete(keys)
@@ -219,7 +219,7 @@ def iter(self, key=None, prefix=None, prefixcount=None, startts=None,
219219
:param requests_params: (optional) a dict with optional requests params.
220220
:param \*\*params: (optional) additional query params for the request.
221221
:return: an iterator over items list.
222-
:rtype: :class:`collections.Iterable[dict]`
222+
:rtype: :class:`collections.abc.Iterable[dict]`
223223
"""
224224
update_kwargs(params, key=key, prefix=prefix, prefixcount=prefixcount,
225225
startts=startts, endts=endts,

scrapinghub/client/frontiers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def iter(self):
9999
"""Iterate through frontiers.
100100
101101
:return: an iterator over frontiers names.
102-
:rtype: :class:`collections.Iterable[str]`
102+
:rtype: :class:`collections.abc.Iterable[str]`
103103
"""
104104
return iter(self.list())
105105

@@ -174,7 +174,7 @@ def iter(self):
174174
"""Iterate through slots.
175175
176176
:return: an iterator over frontier slots names.
177-
:rtype: :class:`collections.Iterable[str]`
177+
:rtype: :class:`collections.abc.Iterable[str]`
178178
"""
179179
return iter(self.list())
180180

@@ -321,7 +321,7 @@ def iter(self, **params):
321321
322322
:param \*\*params: (optional) additional query params for the request.
323323
:return: an iterator over fingerprints.
324-
:rtype: :class:`collections.Iterable[str]`
324+
:rtype: :class:`collections.abc.Iterable[str]`
325325
"""
326326
origin = self._frontier._frontiers._origin
327327
path = (self._frontier.key, 's', self.key, 'f')
@@ -358,7 +358,7 @@ def iter(self, mincount=None, **params):
358358
:param \*\*params: (optional) additional query params for the request.
359359
:return: an iterator over request batches in the queue where each
360360
batch is represented with a dict with ('id', 'requests') field.
361-
:rtype: :class:`collections.Iterable[dict]`
361+
:rtype: :class:`collections.abc.Iterable[dict]`
362362
"""
363363
origin = self._frontier._frontiers._origin
364364
path = (self._frontier.key, 's', self.key, 'q')

scrapinghub/client/items.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def list_iter(self, chunksize=1000, *args, **kwargs):
107107
down by `chunksize`.
108108
109109
:return: an iterator over items, yielding lists of items.
110-
:rtype: :class:`collections.Iterable`
110+
:rtype: :class:`collections.abc.Iterable`
111111
"""
112112

113113
start = kwargs.pop("start", 0)

scrapinghub/client/projects.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def iter(self):
6363
Provided for the sake of API consistency.
6464
6565
:return: an iterator over project ids list.
66-
:rtype: :class:`collections.Iterable[int]`
66+
:rtype: :class:`collections.abc.Iterable[int]`
6767
"""
6868
return iter(self.list())
6969

scrapinghub/client/proxy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def iter(self, _path=None, count=None, requests_params=None, **apiparams):
106106
107107
:param count: limit amount of elements.
108108
:return: an iterator over elements list.
109-
:rtype: :class:`collections.Iterable`
109+
:rtype: :class:`collections.abc.Iterable`
110110
"""
111111
update_kwargs(apiparams, count=count)
112112
apiparams = self._modify_iter_params(apiparams)
@@ -165,7 +165,7 @@ def iter(self):
165165
"""Iterate through key/value pairs.
166166
167167
:return: an iterator over key/value pairs.
168-
:rtype: :class:`collections.Iterable`
168+
:rtype: :class:`collections.abc.Iterable`
169169
"""
170170
return six.iteritems(next(self._origin.apiget()))
171171

0 commit comments

Comments
 (0)