feat: Add bbq.json_value_array and deprecate bbq.json_extract_string_array#1818
Merged
chelsea-lin merged 4 commits intomainfrom Jun 16, 2025
Merged
feat: Add bbq.json_value_array and deprecate bbq.json_extract_string_array#1818chelsea-lin merged 4 commits intomainfrom
chelsea-lin merged 4 commits intomainfrom
Conversation
…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.
shuoweil
approved these changes
Jun 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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