Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f9bb3c4

Browse files
authoredOct 20, 2023
feat: change query parameter to query_or_table in read_gbq (#127)
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ ] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/python-bigquery-dataframes/issues/new/choose) 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) Fixes #<issue_number_goes_here> 🦕
1 parent 694a85a commit f9bb3c4

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed
 

‎bigframes/pandas/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -290,16 +290,16 @@ def read_json(
290290

291291

292292
def read_gbq(
293-
query: str,
293+
query_or_table: str,
294294
*,
295295
index_col: Iterable[str] | str = (),
296296
col_order: Iterable[str] = (),
297297
max_results: Optional[int] = None,
298298
) -> bigframes.dataframe.DataFrame:
299-
_set_default_session_location_if_possible(query)
299+
_set_default_session_location_if_possible(query_or_table)
300300
return global_session.with_default_session(
301301
bigframes.session.Session.read_gbq,
302-
query,
302+
query_or_table,
303303
index_col=index_col,
304304
col_order=col_order,
305305
max_results=max_results,

‎bigframes/session/__init__.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -262,17 +262,17 @@ def close(self):
262262

263263
def read_gbq(
264264
self,
265-
query: str,
265+
query_or_table: str,
266266
*,
267267
index_col: Iterable[str] | str = (),
268268
col_order: Iterable[str] = (),
269269
max_results: Optional[int] = None,
270270
# Add a verify index argument that fails if the index is not unique.
271271
) -> dataframe.DataFrame:
272272
# TODO(b/281571214): Generate prompt to show the progress of read_gbq.
273-
if _is_query(query):
273+
if _is_query(query_or_table):
274274
return self._read_gbq_query(
275-
query,
275+
query_or_table,
276276
index_col=index_col,
277277
col_order=col_order,
278278
max_results=max_results,
@@ -283,7 +283,7 @@ def read_gbq(
283283
# deterministic query so we can avoid serializing if we have a
284284
# unique index.
285285
return self._read_gbq_table(
286-
query,
286+
query_or_table,
287287
index_col=index_col,
288288
col_order=col_order,
289289
max_results=max_results,

‎third_party/bigframes_vendored/pandas/io/gbq.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class GBQIOMixin:
1212
def read_gbq(
1313
self,
14-
query: str,
14+
query_or_table: str,
1515
*,
1616
index_col: Iterable[str] | str = (),
1717
col_order: Iterable[str] = (),
@@ -69,7 +69,7 @@ def read_gbq(
6969
[5 rows x 3 columns]
7070
7171
Args:
72-
query (str):
72+
query_or_table (str):
7373
A SQL string to be executed or a BigQuery table to be read. The
7474
table must be specified in the format of
7575
`project.dataset.tablename` or `dataset.tablename`.

0 commit comments

Comments
 (0)
Failed to load comments.