8000 feat: Add bbq.json_value_array and deprecate bbq.json_extract_string_array by chelsea-lin · Pull Request #1818 · googleapis/python-bigquery-dataframes · GitHub
[go: up one dir, main page]

Skip to content

feat: Add bbq.json_value_array and deprecate bbq.json_extract_string_array #1818

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

Merged
merged 4 commits into from
Jun 16, 2025

Conversation

chelsea-lin
Copy link
Contributor

This change is adding bbq.json_query_array and warning bbq.json_extract_array deprecated. This change aligns with BigQuery SQL, which is deprecating JSON_EXTRACT_STRING_ARRAY method in the doc

…array

This commit introduces the `bbq.json_value_array` method, which provides similar functionality to `JSON_VALUE_ARRAY` in BigQuery Standard SQL. This new function extracts a JSON array and converts its elements to SQL STRING values. It also supports coercing these string values to other data types using the `value_dtype` parameter.

The `bbq.json_extract_string_array` method has been marked as deprecated and will be removed in a future version. You should migrate to `bbq.json_value_array` for equivalent functionality.

The following changes were made:
- Added `JSONValueArray` operation class in `bigframes/operations/json_ops.py`.
- Implemented the `json_value_array` function in `bigframes/bigquery/_operations/json.py`.
- Marked `json_extract_string_array` as deprecated with a `UserWarning` and updated its docstring.
- Added unit tests for `json_value_array` in `tests/unit/bigquery/test_json.py`.
- Added system tests for `json_value_array` in `tests/system/small/bigquery/test_json.py`, covering various input types, JSON structures, and `value_dtype` conversions.
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. labels Jun 13, 2025
@chelsea-lin chelsea-lin marked this pull request as ready for review June 13, 2025 22:24
@chelsea-lin chelsea-lin requested review from a team as code owners June 13, 2025 22:24
@chelsea-lin chelsea-lin added the owlbot:run Add this label to trigger the Owlbot post processor. label Jun 16, 2025
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jun 16, 2025
@chelsea-lin chelsea-lin merged commit 019051e into main Jun 16, 2025
22 of 24 checks passed
@chelsea-lin chelsea-lin deleted the feat-json-value-array branch June 16, 2025 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0