|
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | 14 |
|
15 | | -from datetime import datetime, timezone |
| 15 | +from datetime import datetime, timedelta, timezone |
16 | 16 | import operator |
17 | 17 |
|
18 | 18 | import pytest |
@@ -62,8 +62,8 @@ def rows_to_delete(): |
62 | 62 | def test_table_read_rows_filter_millis(data_table): |
63 | 63 | from google.cloud.bigtable import row_filters |
64 | 64 |
|
65 | | - end = datetime.datetime.now() |
66 | | - start = end - datetime.timedelta(minutes=60) |
| 65 | + end = datetime.now() |
| 66 | + start = end - timedelta(minutes=60) |
67 | 67 | timestamp_range = row_filters.TimestampRange(start=start, end=end) |
68 | 68 | timefilter = row_filters.TimestampRangeFilter(timestamp_range) |
69 | 69 | row_data = data_table.read_rows(filter_=timefilter) |
@@ -241,11 +241,11 @@ def _write_to_row(row1, row2, row3, row4): |
241 | 241 | timestamp1_micros -= timestamp1_micros % 1000 |
242 | 242 | timestamp1 = _datetime_from_microseconds(timestamp1_micros) |
243 | 243 | # 1000 microseconds is a millisecond |
244 | | - timestamp2 = timestamp1 + datetime.timedelta(microseconds=1000) |
| 244 | + timestamp2 = timestamp1 + timedelta(microseconds=1000) |
245 | 245 | timestamp2_micros = _microseconds_from_datetime(timestamp2) |
246 | | - timestamp3 = timestamp1 + datetime.timedelta(microseconds=2000) |
| 246 | + timestamp3 = timestamp1 + timedelta(microseconds=2000) |
247 | 247 | timestamp3_micros = _microseconds_from_datetime(timestamp3) |
248 | | - timestamp4 = timestamp1 + datetime.timedelta(microseconds=3000) |
| 248 | + timestamp4 = timestamp1 + timedelta(microseconds=3000) |
249 | 249 | timestamp4_micros = _microseconds_from_datetime(timestamp4) |
250 | 250 |
|
251 | 251 | if row1 is not None: |
|
0 commit comments