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 — test(bigquery): add tests for concatenating categorical columns by plamut · Pull Request #10180 · googleapis/google-cloud-python

Conversation

@plamut

@plamut plamut commented Jan 22, 2020 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Closes #8044.

This PR adds tests for concatenating multiple-page results that contain categorical column data (both with or without pyarrow available).

It appears that the code already works, provided that a correct explicit categorical dtype is passed to to_dataframe() method.

If dtypes are not specified, a default pandas concatenating behavior results in categorical columns ending up with the dtype "object", but that's already explained in the dtypes parameter's docstring, meaning that the code behaves as advertised.

PR checklist

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

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 Jan 22, 2020
@plamut
plamut requested review from a team and tswast January 22, 2020 14:05
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jan 22, 2020
@plamut
test(bigquery): add tests for concatenating categorical columns
f4d1db0
@plamut plamut changed the title chore(bigquery): add tests for concatenating categorical columns test(bigquery): add tests for concatenating categorical columns Jan 22, 2020
@plamut
plamut force-pushed the iss-8044 branch from 705c43b to f4d1db0 Compare January 22, 2020 14:06
@plamut

plamut commented Jan 30, 2020

Copy link
Copy Markdown
Contributor Author

@tswast Friendly ping. :)

This PR is probably something than can be reviewed and closed quickly (read: before the repo split tomorrow).

All reactions

Sorry, something went wrong.

Uh oh!

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

tswast
tswast approved these changes Jan 30, 2020
View reviewed changes

@tswast tswast left a comment

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.

Thanks!

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
bqstorage_client=bqstorage_client,
dtypes={
"col_category": pandas.core.dtypes.dtypes.CategoricalDtype(
categories=["low", "medium", "high"], ordered=False,

@tswast tswast Jan 30, 2020

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.

[no action required] I suspect there will be users who don't necessarily know the categories ahead of time, though this could trivially be done with a group by / distinct query. If we had a support cookbook, I'd say we should add this info there.

Sorry, something went wrong.

Uh oh!

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

All reactions
@plamut
plamut merged commit 77dd923 into googleapis:master Jan 31, 2020
@plamut
plamut deleted the iss-8044 branch January 31, 2020 07:12
This was referenced Jan 31, 2020
[CHANGE ME] Re-generated automl to pick up changes in the API or client library generator. #10285
Closed
[CHANGE ME] Re-generated bigquery_datatransfer to pick up changes in the API or client library generator. #10286
Closed
[CHANGE ME] Re-generated bigtable to pick up changes in the API or client library generator. #10287
Closed
[CHANGE ME] Re-generated billingbudgets to pick up changes in the API or client library generator. #10288
Closed
[CHANGE ME] Re-generated cloudbuild to pick up changes in the API or client library generator. #10289
Closed
[CHANGE ME] Re-generated datacatalog to pick up changes in the API or client library generator. #10290
Closed
[CHANGE ME] Re-generated firestore to pick up changes in the API or client library generator. #10291
Closed
[CHANGE ME] Re-generated grafeas to pick up changes in the API or client library generator. #10292
Closed
[CHANGE ME] Re-generated iot to pick up changes in the API or client library generator. #10293
Closed
[CHANGE ME] Re-generated language to pick up changes in the API or client library generator. #10294
Closed
[CHANGE ME] Re-generated monitoring to pick up changes in the API or client library generator. #10295
Closed
[CHANGE ME] Re-generated oslogin to pick up changes in the API or client library generator. #10296
Closed
[CHANGE ME] Re-generated phishingprotection to pick up changes in the API or client library generator. #10297
Closed
[CHANGE ME] Re-generated spanner to pick up changes in the API or client library generator. #10298
Closed
[CHANGE ME] Re-generated speech to pick up changes in the API or client library generator. #10299
Closed
[CHANGE ME] Re-generated tasks to pick up changes in the API or client library generator. #10301
Closed
[CHANGE ME] Re-generated texttospeech to pick up changes in the API or client library generator. #10302
Closed
[CHANGE ME] Re-generated vision to pick up changes in the API or client library generator. #10303
Closed
[CHANGE ME] Re-generated webrisk to pick up changes in the API or client library generator. #10304
Closed
This was referenced Feb 2, 2020
[CHANGE ME] Re-generated redis to pick up changes in the API or client library generator. #10319
Closed
[CHANGE ME] Re-generated translate to pick up changes in the API or client library generator. #10320
Closed
[CHANGE ME] Re-generated bigquery_datatransfer to pick up changes in the API or client library generator. #10328
Closed
[CHANGE ME] Re-generated dataproc to pick up changes in the API or client library generator. #10329
Closed
[CHANGE ME] Re-generated grafeas to pick up changes in the API or client library generator. #10330
Closed
[CHANGE ME] Re-generated kms to pick up changes in the API or client library generator. #10331
Closed
[CHANGE ME] Re-generated language to pick up changes in the API or client library generator. #10332
Closed
[CHANGE ME] Re-generated monitoring to pick up changes in the API or client library generator. #10333
Closed
[CHANGE ME] Re-generated oslogin to pick up changes in the API or client library generator. #10334
Closed
[CHANGE ME] Re-generated phishingprotection to pick up changes in the API or client library generator. #10335
Closed
[CHANGE ME] Re-generated tasks to pick up changes in the API or client library generator. #10336
Closed
[CHANGE ME] Re-generated dataproc to pick up changes in the API or client library generator. #10339
Closed
[CHANGE ME] Re-generated grafeas to pick up changes in the API or client library generator. #10340
Closed
[CHANGE ME] Re-generated iot to pick up changes in the API or client library generator. #10341
Closed
[CHANGE ME] Re-generated irm to pick up changes in the API or client library generator. #10342
Closed
[CHANGE ME] Re-generated kms to pick up changes in the API or client library generator. #10343
Closed
[CHANGE ME] Re-generated language to pick up changes in the API or client library generator. #10344
Closed
[CHANGE ME] Re-generated monitoring to pick up changes in the API or client library generator. #10345
Closed
[CHANGE ME] Re-generated dataproc to pick up changes in the API or client library generator. #10349
Closed
[CHANGE ME] Re-generated grafeas to pick up changes in the API or client library generator. #10350
Closed
[CHANGE ME] Re-generated irm to pick up changes in the API or client library generator. #10351
Closed
[CHANGE ME] Re-generated oslogin to pick up changes in the API or client library generator. #10352
Closed
[CHANGE ME] Re-generated phishingprotection to pick up changes in the API or client library generator. #10353
Closed
[CHANGE ME] Re-generated tasks to pick up changes in the API or client library generator. #10354
Closed
[CHANGE ME] Re-generated asset to pick up changes in the API or client library generator. #10359
Closed
[CHANGE ME] Re-generated grafeas to pick up changes in the API or client library generator. #10360
Closed
[CHANGE ME] Re-generated language to pick up changes in the API or client library generator. #10361
Closed
[CHANGE ME] Re-generated oslogin to pick up changes in the API or client library generator. #10362
Closed
[CHANGE ME] Re-generated recommender to pick up changes in the API or client library generator. #10363
Closed
[CHANGE ME] Re-generated tasks to pick up changes in the API or client library generator. #10364
Closed
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: use union categorical to concatenate pages in to_dataframe when categorical dtype is requested

Uh oh!

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

3 participants

@plamut @tswast @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.