-
Notifications
You must be signed in to change notification settings - Fork 63
fix: support results with STRUCT and ARRAY columns containing JSON subfields in to_pandas_batches()
#2216
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
fix: support results with STRUCT and ARRAY columns containing JSON subfields in to_pandas_batches()
#2216
Changes from 4 commits
8c34512
05e9b69
aa04bac
592e43b
3b86941
5955bfe
d07ba7e
9b1fb93
d7455a6
066b8d6
12e2a63
393a2f9
2ff0108
512e3a1
5f5881b
3119771
be1dea4
5ed4293
0d50c6d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -954,6 +954,21 @@ def contains_db_dtypes_json_dtype(dtype): | |||||
| return contains_db_dtypes_json_arrow_type(dtype.pyarrow_dtype) | ||||||
|
|
||||||
|
|
||||||
| def _replace_json_arrow_with_string(pa_type: pa.DataType) -> pa.DataType: | ||||||
|
||||||
| def _has_json_arrow_type(arrow_type: pa.DataType) -> bool: |
| def contains_db_dtypes_json_arrow_type(type_): |
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.
Since I removed this function, this code refactor is no longer relevant to this PR. I will start a new PR (#2221) for this code refactor.
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.
@chelsea-lin I assume we have similar code that does this, right? Maybe there's something that could be reused here?
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.
Yeah, we have something similar in the loader component but they're slightly different.
python-bigquery-dataframes/bigframes/session/loader.py
Line 1319 in 316ba9f
Also, I agree that we can simply logic a little bit, for example:
Uh oh!
There was an error while loading. Please reload this page.
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.
The logic has been simplified
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.
Thanks! The new logic looks even better!