MCPcopy Create free account
hub / github.com/apache/cassandra-python-driver / fetch_size

Method fetch_size

cassandra/cqlengine/query.py:917–939  ·  view source on GitHub ↗

Sets the number of rows that are fetched at a time. *Note that driver's default fetch size is 5000.* .. code-block:: python for user in User.objects().fetch_size(500): print(user)

(self, v)

Source from the content-addressed store, hash-verified

915 return clone
916
917 def fetch_size(self, v):
918 """
919 Sets the number of rows that are fetched at a time.
920
921 *Note that driver's default fetch size is 5000.*
922
923 .. code-block:: python
924
925 for user in User.objects().fetch_size(500):
926 print(user)
927 """
928
929 if not isinstance(v, int):
930 raise TypeError
931 if v == self._fetch_size:
932 return self
933
934 if v < 1:
935 raise QueryException("fetch size less than 1 is not allowed")
936
937 clone = copy.deepcopy(self)
938 clone._fetch_size = v
939 return clone
940
941 def allow_filtering(self):
942 """

Callers 1

test_defaultFetchSizeMethod · 0.80

Calls 1

QueryExceptionClass · 0.85

Tested by 1

test_defaultFetchSizeMethod · 0.64