Skip to content

Commit 7cae3f4

Browse files
authored
chore: remove an unused parameter in _rows_to_dataframe (#813)
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 - [X] Ensure the tests and linter pass - [X] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Fixes #<issue_number_goes_here> 🦕
1 parent 067ff17 commit 7cae3f4

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

bigframes/core/blocks.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -438,9 +438,7 @@ def reorder_levels(self, ids: typing.Sequence[str]):
438438

439439
def _to_dataframe(self, result) -> pd.DataFrame:
440440
"""Convert BigQuery data to pandas DataFrame with specific dtypes."""
441-
dtypes = dict(zip(self.index_columns, self.index.dtypes))
442-
dtypes.update(zip(self.value_columns, self.dtypes))
443-
result_dataframe = self.session._rows_to_dataframe(result, dtypes)
441+
result_dataframe = self.session._rows_to_dataframe(result)
444442
# Runs strict validations to ensure internal type predictions and ibis are completely in sync
445443
# Do not execute these validations outside of testing suite.
446444
if "PYTEST_CURRENT_TEST" in os.environ:
@@ -2582,15 +2580,14 @@ def to_pandas(self, *, ordered: Optional[bool] = None) -> pd.Index:
25822580
)
25832581
# Project down to only the index column. So the query can be cached to visualize other data.
25842582
index_columns = list(self._block.index_columns)
2585-
dtypes = dict(zip(index_columns, self.dtypes))
25862583
expr = self._expr.select_columns(index_columns)
25872584
results, _ = self.session._execute(
25882585
expr,
25892586
ordered=ordered
25902587
if (ordered is not None)
25912588
else self.session._strictly_ordered,
25922589
)
2593-
df = expr.session._rows_to_dataframe(results, dtypes)
2590+
df = expr.session._rows_to_dataframe(results)
25942591
df = df.set_index(index_columns)
25952592
index = df.index
25962593
index.names = list(self._block._index_labels) # type:ignore

bigframes/session/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2038,7 +2038,7 @@ def _get_table_size(self, destination_table):
20382038
return table.num_bytes
20392039

20402040
def _rows_to_dataframe(
2041-
self, row_iterator: bigquery.table.RowIterator, dtypes: Dict
2041+
self, row_iterator: bigquery.table.RowIterator
20422042
) -> pandas.DataFrame:
20432043
# Can ignore inferred datatype until dtype emulation breaks 1:1 mapping between BQ types and bigframes types
20442044
dtypes_from_bq = bigframes.dtypes.bf_type_from_type_kind(row_iterator.schema)

0 commit comments

Comments
 (0)