feat!: Enable reading JSON data with dbjson extension dtype#1139
feat!: Enable reading JSON data with dbjson extension dtype#1139
dbjson extension dtype#1139Conversation
dbjson extension dtypedbjson extension dtype
dbjson extension dtypedbjson extension dtype
tswast
left a comment
There was a problem hiding this comment.
Very cool!
Let's make sure we mark this as a "breaking change" in our release notes (https://github.com/googleapis/release-please/blob/main/README.md#how-should-i-write-my-commits)
Since it's a breaking change for a preview feature, we shouldn't bump to 2.0 though. Let's use the Release-As footer in the commit message to make sure we do a 1.x release. https://github.com/googleapis/release-please/blob/main/README.md#how-do-i-change-the-version-number
7c81975 to
48ca926
Compare
48ca926 to
2707038
Compare
2707038 to
6e1aacc
Compare
| # b/381148539 | ||
| def test_json_in_struct(): | ||
| df = bpd.read_gbq( | ||
| "SELECT STRUCT(JSON '{\\\"a\\\": 1}' AS data, 1 AS number) as struct_col" | ||
| ) | ||
| assert df["struct_col"].struct.field("data")[0] == '{"a":1}' |
There was a problem hiding this comment.
Should we keep / update this test, instead? I'd like to make sure we avoid regressions since I believe this was added to make sure we can work with some AI/ML/ObjectRef features.
There was a problem hiding this comment.
Yes, I moved this test to test_dataframe_io.py. Also add similar tests for both struct and array
Co-authored-by: Tim Sweña (Swast) <swast@google.com>
This change updates how we handle JSON data types read from BigQuery. Previously, BigQuery JSON types were treated as generic large strings within our system. To improve accuracy and functionality, we now map them to a dedicated JSON data type (db_dtypes.JSONType or db_dtypes.JSONArrowType for pyarrow). While this provides a more appropriate representation of JSON data, it's important to note that this feature is still in preview and may evolve. Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Tim Sweña (Swast) <swast@google.com> Release-As: 1.34.0
This change updates how we handle JSON data types read from BigQuery. Previously, BigQuery JSON types were treated as generic large strings within our system. To improve accuracy and functionality, we now map them to a dedicated JSON data type (db_dtypes.JSONType or db_dtypes.JSONArrowType for pyarrow). While this provides a more appropriate representation of JSON data, it's important to note that this feature is still in preview and may evolve. Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Tim Sweña (Swast) <swast@google.com> Release-As: 1.34.0
feat!: Enable reading JSON data with dbjson extension dtype (#1139)
This change updates how we handle JSON data types read from BigQuery.
Previously, BigQuery JSON types were treated as generic large strings within our system. To improve accuracy and functionality, we now map them to a dedicated JSON data type (
db_dtypes.JSONTypeordb_dtypes.JSONArrowTypefor pyarrow).While this provides a more appropriate representation of JSON data, it's important to note that this feature is still in preview and may evolve.
Release-As: 1.34.0
Fixes internal issue 377764399 🦕