Skip to content

feat: bigframes.bigquery.parse_json #1265

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 3 commits into from
Jan 8, 2025
Merged

Conversation

chelsea-lin
Copy link
Contributor

This change is adding bigframes.bigquery.parse_json, which can convert a series with a JSON-formatted STRING to a JSON type.

  • Make sure to open an issue as an internal bug 346572448
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes internal issue 346572448🦕

@chelsea-lin chelsea-lin requested review from a team as code owners January 6, 2025 22:21
@chelsea-lin chelsea-lin requested a review from shuoweil January 6, 2025 22:21
@product-auto-label product-auto-label bot added the size: m Pull request size is medium. label Jan 6, 2025
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. label Jan 6, 2025
dtype: string
>>> bbq.parse_json(s)
0 {"class":{"students":[{"id":5},{"id":12}]}}
dtype: large_string[pyarrow]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We plan to change this in future, right?

Make sure to make this function as Preview in our documentation and raise a subclass of our Preview warning when users use this function.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a preview warning on the docstring, and a "preview" decorator for a warning message. Please double check. Thanks!

@chelsea-lin chelsea-lin force-pushed the main_chelsealin_parse_json branch 2 times, most recently from b56d211 to f2ccc56 Compare January 7, 2025 19:47
@chelsea-lin chelsea-lin requested a review from tswast January 7, 2025 19:48
@chelsea-lin chelsea-lin force-pushed the main_chelsealin_parse_json branch from bcd8c10 to 8568243 Compare January 8, 2025 17:54
@chelsea-lin chelsea-lin merged commit 27bbd80 into main Jan 8, 2025
22 checks passed
@chelsea-lin chelsea-lin deleted the main_chelsealin_parse_json branch January 8, 2025 21:52
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.

4 participants