-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
api: bigtableIssues related to the Bigtable API.Issues related to the Bigtable API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Bigtable supports millisecond granularity but using microsecond granularity in TimestampRange
Therefore, it was the result in the following error:
Timestamp granularity mismatch. Expected a multiple of 1000 (millisecond granularity), but got 1519628106494933.
Code
end = datetime.datetime.now()
start = end - datetime.timedelta(minutes = 60)
timefilter = TimestampRangeFilter(TimestampRange(start=start, end=end))
row_data = table.read_rows(filter_=timefilter)
row_data.consume_all()Stacktrace
_RendezvousTraceback (most recent call last)
<ipython-input-69-b9d4b2239efa> in <module>()
4 timefilter = TimestampRangeFilter(TimestampRange(start=start, end=end))
5 row_data = table.read_rows(filter_=timefilter)
----> 6 row_data.consume_all()
/usr/local/envs/py2env/lib/python2.7/site-packages/google/cloud/bigtable/row_data.pyc in consume_all(self, max_loops)
325 curr_loop += 1
326 try:
--> 327 self.consume_next()
328 except StopIteration:
329 break
/usr/local/envs/py2env/lib/python2.7/site-packages/google/cloud/bigtable/row_data.pyc in consume_next(self)
259 :attr:`_rows`. Rows are returned in order by row key.
260 """
--> 261 response = six.next(self._response_iterator)
262 self._counter += 1
263
/usr/local/envs/py2env/lib/python2.7/site-packages/grpc/_channel.pyc in next(self)
348
349 def next(self):
--> 350 return self._next()
351
352 def is_active(self):
/usr/local/envs/py2env/lib/python2.7/site-packages/grpc/_channel.pyc in _next(self)
339 raise StopIteration()
340 elif self._state.code is not None:
--> 341 raise self
342
343 def __iter__(self):
_Rendezvous: <_Rendezvous of RPC that terminated with (StatusCode.INVALID_ARGUMENT, Error in field 'timestamp_range_filter' : Timestamp granularity mismatch. Expected a multiple of 1000 (millisecond granularity), but got 1519628106494933.)>```
Metadata
Metadata
Assignees
Labels
api: bigtableIssues related to the Bigtable API.Issues related to the Bigtable API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.