feat: add PendingDeprecationWarning for to_dataframe and to_arrow conversion methods - #18021
feat: add PendingDeprecationWarning for to_dataframe and to_arrow conversion methods#18021shuoweil wants to merge 6 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request deprecates the core SDK conversion methods to_arrow and to_dataframe by adding PendingDeprecationWarning warnings, recommending direct usage of pandas_gbq instead. It also ensures internal calls (such as in to_geodataframe) suppress these warnings, and adds unit tests to verify this behavior. The feedback suggests explicitly setting warnings.simplefilter("always") in the test for to_geodataframe to guarantee that the PendingDeprecationWarning is not silently ignored by Python's default warning filters.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
| ) | ||
|
|
||
| _TO_DATAFRAME_DEPRECATED = ( | ||
| "Retrieving DataFrames via core SDK conversion methods is deprecated. " |
There was a problem hiding this comment.
Should we replace "core SDK" with "google-cloud-bigquery" ? The user might not understand what "core SDK" means
There was a problem hiding this comment.
Good point! Updated to "Retrieving DataFrames via google-cloud-bigquery is deprecated. For direct, optimized access, please call 'pandas_gbq.read_gbq()' directly."
| ) | ||
|
|
||
| _TO_ARROW_DEPRECATED = ( | ||
| "Retrieving PyArrow Tables via core SDK conversion methods is deprecated. " |
There was a problem hiding this comment.
Maybe update the "core SDK" mentioning here too
There was a problem hiding this comment.
Done, updated here as well.
As part of the
pandas-gbqmigration and API unification strategy, this PR introducesPendingDeprecationWarningto the core conversion wrapper methods ingoogle-cloud-bigquery.This alerts developers to adopt direct, optimized
pandas-gbqentry points (pandas_gbq.read_gbq()andpandas_gbq.arrow.*) ahead of future deprecation phases.Fixes #<526614511> 🦕