GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(bigquery): make rowIterator._to_dataframe_iterable public by HemangChothani · Pull Request #10017 · googleapis/google-cloud-python

Conversation

@HemangChothani

@HemangChothani HemangChothani commented Dec 26, 2019

Copy link
Copy Markdown
Contributor

Fixes #7339

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@HemangChothani
feat(bigquery): make rowIterator._to_dataframe_iterable public
57776d9
@HemangChothani
HemangChothani requested review from a team and tswast December 26, 2019 05:52
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Dec 26, 2019
tswast
tswast reviewed Dec 26, 2019
View reviewed changes
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()

@tswast tswast Dec 26, 2019

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

self.assertIsInstance(df, types.GeneratorType)

a = next(df)

@tswast tswast Dec 26, 2019

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
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})

@tswast tswast Dec 26, 2019

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
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):

@tswast tswast Dec 26, 2019

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@plamut plamut added the api: bigquery Issues related to the BigQuery API. label Dec 26, 2019
@HemangChothani
feat(bigquery): cosmetic changes and unittest change
eb5113a
tswast
tswast previously approved these changes Dec 27, 2019
View reviewed changes
tswast
tswast reviewed Dec 27, 2019
View reviewed changes
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"

@tswast tswast Dec 27, 2019

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

Concerned about use of private _get_value in unit tests.

@HemangChothani
feat(bigquery): change as per comment
5aa9058
@HemangChothani

HemangChothani commented Jan 7, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

@tswast PTAL.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tswast
tswast self-requested a review January 7, 2020 17:12
tswast
tswast approved these changes Jan 10, 2020
View reviewed changes
@tswast
tswast merged commit 240f381 into googleapis:master Jan 10, 2020
This was referenced Jan 29, 2020
chore(asset): bump copyright year to 2020, tweak docstring formatting (via synth) #10223
Merged
chore(automl): bump copyright year to 2020, tweak docstring formatting (via synth) #10224
Merged
chore(bigquery): bump copyright year to 2020, tweak docstring formatting (via synth) #10225
Merged
chore(billingbudgets): bump copyright year to 2020, tweak docstring formatting (via synth) #10227
Merged
docs(datalabeling): update docstrings; bump copyright year to 2020 (via synth) #10229
Merged
feat(documentai): bump copyright year to 2020, tweak docstring formatting (via synth) #10230
Merged
fix(iam): bump copyright year to 2020 (via synth) #10231
Merged
chore(iot): bump copyright year to 2020 (via synth) #10232
Merged
fix(irm): change default retry and timeout config; bump copyright year to 2020 (via synth) #10233
Merged
docs(language): change docstring formatting; bump copyright year to 2020 (via synth) #10234
Merged
chore(phishingprotection): bump copyright year to 2020 (via synth) #10235
Merged
chore(redis): bump copyright year to 2020, tweak docstring formatting (via synth) #10237
Merged
chore(speech): bump copyright year to 2020, tweak docstring formatting (via synth) #10238
Merged
fix(talent): change default timeout values; edit docstrings; bump copyright year to 2020 (via synth) #10239
Merged
chore(texttospeech): bump copyright year to 2020, tweak docstring formatting (via synth) #10240
Merged
This was referenced Jan 29, 2020
chore(trace): bump copyright year to 2020, tweak docstring formatting (via synth) #10241
Merged
chore(vision): bump copyright year to 2020, tweak docstring formatting (via synth) #10242
Merged
chore(websecurityscanner): bump copyright year to 2020, tweak docstring formatting (via synth) #10243
Merged
[CHANGE ME] Re-generated container to pick up changes in the API or client library generator. #10256
Closed
[CHANGE ME] Re-generated datastore to pick up changes in the API or client library generator. #10261
Closed
@HemangChothani
HemangChothani deleted the bigquery_make_to_frame_iterable_public branch January 31, 2020 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@tswast tswast tswast approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

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

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

BigQuery: Make RowIterator._to_dataframe_iterable public

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@HemangChothani @tswast @plamut @googlebot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.