feat: adds bigframes.bigquery.array_to_string to convert array elements to delimited strings#731
Merged
chelsea-lin merged 1 commit intomainfrom May 30, 2024
Merged
Conversation
…ts to delimited strings
tswast
approved these changes
May 30, 2024
| ) | ||
|
|
||
|
|
||
| def array_to_string(series: series.Series, delimiter: str) -> series.Series: |
Contributor
There was a problem hiding this comment.
Should we add null_text as an optional parameter, too?
https://cloud.google.com/bigquery/docs/reference/standard-sql/array_functions#array_to_string
I recall it's a bit difficult to test arrays containing nulls since there are many paths that don't support them, so I'm okay omitting for now.
Contributor
Author
There was a problem hiding this comment.
I initially experimented with using null_text but determined it wasn't beneficial at this stage. The null_text parameter is designed to handle null values within arrays, whereas BF arrays cannot contain nulls. This stems from BigQuery's behavior of permitting nulls in intermediate query results but not in materialized views or tables.
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.
Fixes internal issue: 342668759 🦕