-
Notifications
You must be signed in to change notification settings - Fork 48
feat!: Enable reading JSON data with dbjson
extension dtype
#1139
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
Conversation
dbjson
extension dtypedbjson
extension dtype
dbjson
extension dtypedbjson
extension dtype
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) <[email protected]>
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) <[email protected]> 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) <[email protected]> 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.JSONType
ordb_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.
Release-As: 1.34.0
Fixes internal issue 377764399 🦕