FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(bigquery): make rowIterator._to_dataframe_iterable public by HemangChothani · Pull Request #10017 · googleapis/google-cloud-python · GitHub

feat(bigquery): make rowIterator._to_dataframe_iterable public - #10017

Merged
tswast merged 3 commits into
googleapis:masterfrom
MaxxleLLC:bigquery_make_to_frame_iterable_public
Jan 10, 2020
Merged

feat(bigquery): make rowIterator._to_dataframe_iterable public#10017
tswast merged 3 commits into
googleapis:masterfrom
MaxxleLLC:bigquery_make_to_frame_iterable_public

Conversation

Copy link
Copy Markdown
Contributor

Fixes #7339

HemangChothani requested review from a team and tswast December 26, 2019 05:52
googlebot added the cla: yes This human has signed the Contributor License Agreement. label Dec 26, 2019
Comment thread bigquery/tests/unit/test_table.py Outdated
row_iterator = self._make_one(
_mock_client(), api_request, path, schema, page_size=1, max_results=5
)
df = row_iterator.to_dataframe_iterable()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Since this is a generator, use a plural for the variable name dfs or dataframes.

Comment thread bigquery/tests/unit/test_table.py Outdated

self.assertIsInstance(df, types.GeneratorType)

a = next(df)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

a is a Pandas DataFrame, so df or dataframe would be a more appropriate name.

Comment thread bigquery/tests/unit/test_table.py Outdated
{"f": [{"v": "Bhettye Rhubble"}, {"v": "27"}]},
]
path = "/foo"
api_request = mock.Mock(return_value={"rows": rows})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I'd like to see side_effect used to test with multiple pages.

Comment thread bigquery/tests/unit/test_table.py Outdated
api_request = mock.Mock(return_value={"rows": rows})
row_iterator = self._make_one(_mock_client(), api_request, path, schema)

with self.assertRaises(ValueError):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Let's use pytest.raises and match="pandas" to make sure that the ValueError occurs because of the missing pandas dependency.

plamut added the api: bigquery Issues related to the BigQuery API. label Dec 26, 2019
tswast previously approved these changes Dec 27, 2019
Comment thread bigquery/tests/unit/test_table.py Outdated
self.assertEqual(df_1.age.dtype.name, "int64")
self.assertEqual(len(df_1), 1) # verify the number of rows
self.assertEqual(
df_1.name._get_value(0), "Bengt"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Why use _get_value(0) instead of df_1["name"][0]?

tswast dismissed their stale review December 27, 2019 15:32

Concerned about use of private _get_value in unit tests.

HemangChothani commented Jan 7, 2020
edited
Loading

Copy link
Copy Markdown
Contributor Author

@tswast PTAL.

tswast self-requested a review January 7, 2020 17:12
tswast merged commit 240f381 into googleapis:master Jan 10, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigquery Issues related to the BigQuery API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BigQuery: Make RowIterator._to_dataframe_iterable public

4 participants


Back | FazBrowse Home | New Git URL