Skip to content

Commit

Permalink
Resolve some rebase craziness
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Wayne Parrott committed Jun 28, 2017
1 parent 48d1c40 commit 4494e10
Show file tree
Hide file tree
Showing 3 changed files with 295 additions and 329 deletions.
41 changes: 1 addition & 40 deletions bigquery/google/cloud/bigquery/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from google.cloud._helpers import _millis_from_datetime
from google.cloud.exceptions import NotFound
from google.cloud.exceptions import make_exception
from google.cloud.iterator import HTTPIterator
from google.cloud.bigquery.schema import SchemaField
from google.cloud.bigquery._helpers import _item_to_row
from google.cloud.bigquery._helpers import _rows_page_start
Expand Down Expand Up @@ -1163,46 +1164,6 @@ def _build_schema_resource(fields):
info['fields'] = _build_schema_resource(field.fields)
infos.append(info)
return infos


def _item_to_row(iterator, resource):
"""Convert a JSON row to the native object.
.. note::
This assumes that the ``schema`` attribute has been
added to the iterator after being created, which
should be done by the caller.
:type iterator: :class:`~google.cloud.iterator.Iterator`
:param iterator: The iterator that is currently in use.
:type resource: dict
:param resource: An item to be converted to a row.
:rtype: tuple
:returns: The next row in the page.
"""
return _row_from_json(resource, iterator.schema)


# pylint: disable=unused-argument
def _rows_page_start(iterator, page, response):
"""Grab total rows after a :class:`~google.cloud.iterator.Page` started.
:type iterator: :class:`~google.cloud.iterator.Iterator`
:param iterator: The iterator that is currently in use.
:type page: :class:`~google.cloud.iterator.Page`
:param page: The page that was just created.
:type response: dict
:param response: The JSON API response for a page of rows in a table.
"""
total_rows = response.get('totalRows')
if total_rows is not None:
total_rows = int(total_rows)
iterator.total_rows = total_rows
# pylint: enable=unused-argument


Expand Down
3 changes: 3 additions & 0 deletions bigquery/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@

REQUIREMENTS = [
'google-cloud-core >= 0.25.0, < 0.26dev',
'google-auth >= 1.0.0',
'google-resumable-media >= 0.1.1',
'requests >= 2.0.0',
]

setup(
Expand Down

0 comments on commit 4494e10

Please sign in to comment.