Uh oh!
There was an error while loading. Please reload this page.
Move BigQuery list_ methods to use iterators - #2565
Conversation
| TEST_RC_REPLACEMENTS = { | ||
| 'FORMAT': { | ||
| 'max-module-lines': 1960, | ||
| 'max-module-lines': 2000, |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| page_token=page_token, max_results=max_results, | ||
| page_start=_rows_page_start) | ||
| iterator.schema = self._schema | ||
| # Over-ride the key used to retrieve the next page token. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| def _row_from_json(row, schema): | ||
| """Convert JSON row data to row w/ appropriate types. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| """Convert JSON row data to row w/ appropriate types. | ||
| :type row: dict | ||
| :param row: |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| return _row_from_json(resource, iterator.schema) | ||
| # pylint: disable=unused-argument |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| max_results=MAX, | ||
| page_token=TOKEN) | ||
| iterator = table.fetch_data( | ||
| client=client2, max_results=MAX, page_token=TOKEN) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
dhermes
commented
Oct 19, 2016
@tseaver Can you weigh in here? I'm especially curious how you feel about |
tseaver
commented
Oct 20, 2016
+0 for adding it to -1 for adding it to |
dhermes
commented
Oct 20, 2016
Check out the implementation, I put |
| """ | ||
| total_rows = response.get('totalRows') | ||
| if total_rows is not None: | ||
| page.total_rows = int(total_rows) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
tseaver
commented
Oct 20, 2016
LGTM, once you decide about my question about where |
dhermes
commented
Oct 20, 2016
@tseaver I'll put |
dhermes
commented
Oct 20, 2016
@tseaver I started writing the code to put Given this scenario, it seems like |
tseaver
commented
Oct 20, 2016
@dhermes For queries, the docs say For tables, the docs say only that |
tseaver
commented
Oct 25, 2016
@fhoffa Can you chime in on how stable the |
In particular, isolating the logic useful to work on a single row.
e439de8 to
d3a6dffCompareAlso fixing BigQuery system test in the process.
dhermes
commented
Nov 1, 2016
@tseaver I put |
Move BigQuery list_ methods to use iterators
Follow up to #2561. This only covers
Dataset.list_tables()andTable.fetch_data(). It may also be "correct" to use an Iterator inQueryResults.fetch_dataQueryResults.run(viaQueryResults._build_resource)but I wanted to get eyes on this change first / opinion from the original author (@tseaver) before moving forward.