Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.

Commit f4fcc4e

Browse files
authored
chore: drop six (#310)
1 parent 06bdecd commit f4fcc4e

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎google/cloud/bigquery_storage_v1/reader.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from __future__ import absolute_import
1616

1717
import collections
18+
import io
1819
import json
1920

2021
try:
@@ -31,7 +32,6 @@
3132
import pyarrow
3233
except ImportError: # pragma: NO COVER
3334
pyarrow = None
34-
import six
3535

3636
try:
3737
import pyarrow
@@ -400,7 +400,7 @@ def _dtypes_from_avro(self, avro_fields):
400400
if isinstance(field_info["type"], list):
401401
type_info = next(item for item in field_info["type"] if item != "null")
402402

403-
if isinstance(type_info, six.string_types):
403+
if isinstance(type_info, str):
404404
field_dtype = type_map.get(type_info, "object")
405405
else:
406406
logical_type = type_info.get("logicalType")
@@ -461,7 +461,7 @@ def next(self):
461461
self._parse_rows()
462462
if self._remaining > 0:
463463
self._remaining -= 1
464-
return six.next(self._iter_rows)
464+
return next(self._iter_rows)
465465

466466
# Alias needed for Python 2/3 support.
467467
__next__ = next
@@ -652,7 +652,7 @@ def to_rows(self, message):
652652
A sequence of rows, represented as dictionaries.
653653
"""
654654
self._parse_fastavro()
655-
messageio = six.BytesIO(message.avro_rows.serialized_binary_rows)
655+
messageio = io.BytesIO(message.avro_rows.serialized_binary_rows)
656656
while True:
657657
# Loop in a while loop because schemaless_reader can only read
658658
# a single record.

‎tests/unit/test_reader_v1.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
# limitations under the License.
1616

1717
import itertools
18+
import io
1819
import json
1920
from unittest import mock
2021

2122
import fastavro
2223
import pandas
2324
import pandas.testing
2425
import pytest
25-
import six
2626

2727
import google.api_core.exceptions
2828
from google.cloud.bigquery_storage import types
@@ -68,7 +68,7 @@ def _bq_to_avro_blocks(bq_blocks, avro_schema_json):
6868
avro_blocks = []
6969
first_message = True
7070
for block in bq_blocks:
71-
blockio = six.BytesIO()
71+
blockio = io.BytesIO()
7272
for row in block:
7373
fastavro.schemaless_writer(blockio, avro_schema, row)
7474
response = types.ReadRowsResponse()

0 commit comments

Comments
 (0)