-
Notifications
You must be signed in to change notification settings - Fork 14
Add columns argument to read_gbq #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -82,3 +82,16 @@ def test_read_kwargs(dataset, client): | |
|
|
||
| with pytest.raises(Exception, match="504 Deadline Exceeded"): | ||
| ddf.compute() | ||
|
|
||
|
|
||
| def test_read_columns(df, dataset, client): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Overall this test looks great. One small suggestions: could we add assert df.shape[1] > 1to ensure that the original |
||
| project_id, dataset_id, table_id = dataset | ||
| columns = ["name"] | ||
| ddf = read_gbq( | ||
| project_id=project_id, | ||
| dataset_id=dataset_id, | ||
| table_id=table_id, | ||
| columns=columns, | ||
| ) | ||
|
|
||
| assert list(ddf.columns) == columns | ||
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.
Nitpick: I'm by no means a type annotation expert, but from reviewing dask/distributed#5328, I think the recommend approach for a list would be to add
from __future__ import annotationsand then just use the built-inlistin the type annotation (i.e.list[str]). This isn't meant to be a blocking comment as what you have here is valid. Just meant as an FYIThere 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.
oh yeah, good call..I'm used to
list[]for 3.9 but forgot about the__future__option