Skip to content

Commit

Permalink
chore: drop six (#427)
Browse files Browse the repository at this point in the history
  • Loading branch information
tseaver committed Sep 21, 2021
1 parent 29cd798 commit a3192fa
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
4 changes: 1 addition & 3 deletions google/cloud/bigtable/row.py
Expand Up @@ -17,8 +17,6 @@

import struct

import six

from google.cloud._helpers import _datetime_from_microseconds
from google.cloud._helpers import _microseconds_from_datetime
from google.cloud._helpers import _to_bytes
Expand Down Expand Up @@ -151,7 +149,7 @@ def _set_cell(self, column_family_id, column, value, timestamp=None, state=None)
:meth:`_get_mutations`.
"""
column = _to_bytes(column)
if isinstance(value, six.integer_types):
if isinstance(value, int):
value = _PACK_I64(value)
value = _to_bytes(value)
if timestamp is None:
Expand Down
7 changes: 3 additions & 4 deletions google/cloud/bigtable/row_data.py
Expand Up @@ -16,7 +16,6 @@


import copy
import six

import grpc

Expand Down Expand Up @@ -169,8 +168,8 @@ def to_dict(self):
:returns: Dictionary containing all the data in the cells of this row.
"""
result = {}
for column_family_id, columns in six.iteritems(self._cells):
for column_qual, cells in six.iteritems(columns):
for column_family_id, columns in self._cells.items():
for column_qual, cells in columns.items():
key = _to_bytes(column_family_id) + b":" + _to_bytes(column_qual)
result[key] = cells
return result
Expand Down Expand Up @@ -467,7 +466,7 @@ def _on_error(self, exc):

def _read_next(self):
"""Helper for :meth:`__iter__`."""
return six.next(self.response_iterator)
return next(self.response_iterator)

def _read_next_response(self):
"""Helper for :meth:`__iter__`."""
Expand Down
3 changes: 1 addition & 2 deletions tests/unit/test_row.py
Expand Up @@ -132,7 +132,6 @@ def _set_cell_helper(
timestamp=None,
timestamp_micros=-1,
):
import six
import struct

row_key = b"row_key"
Expand All @@ -144,7 +143,7 @@ def _set_cell_helper(
self.assertEqual(row._pb_mutations, [])
row.set_cell(column_family_id, column, value, timestamp=timestamp)

if isinstance(value, six.integer_types):
if isinstance(value, int):
value = struct.pack(">q", value)
expected_pb = _MutationPB(
set_cell=_MutationSetCellPB(
Expand Down
3 changes: 1 addition & 2 deletions tests/unit/test_table.py
Expand Up @@ -1589,13 +1589,12 @@ def _make_responses_statuses(self, codes):
return response

def _make_responses(self, codes):
import six
from google.cloud.bigtable_v2.types.bigtable import MutateRowsResponse
from google.rpc.status_pb2 import Status

entries = [
MutateRowsResponse.Entry(index=i, status=Status(code=codes[i]))
for i in six.moves.xrange(len(codes))
for i in range(len(codes))
]
return MutateRowsResponse(entries=entries)

Expand Down

0 comments on commit a3192fa

Please sign in to comment.