Skip to content
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

GH-37861: [C#] Fix StringArray.GetString returning null instead of empty #37862

Merged
merged 2 commits into from
Oct 16, 2023

Conversation

spanglerco
Copy link
Contributor

@spanglerco spanglerco commented Sep 25, 2023

Rationale for this change

Fixes #37861.

What changes are included in this PR?

Add BinaryArray.GetBytes(int, out bool) overload that enables StringArray.GetString to reliably determine if the value is null or empty without needing an additional call to IsNull.

Are these changes tested?

Added a test for StringArray.GetString (which didn't appear to have any existing tests). Two of the cases fail without this change. I also updated the tests that call BinaryArray.GetBytes to use the new overload instead of a separate call to IsNull as extra validation.

Are there any user-facing changes?

New public overload to an existing API.

@github-actions
Copy link

⚠️ GitHub issue #37861 has been automatically assigned in GitHub to PR creator.

Copy link
Member

@westonpace westonpace left a comment

Choose a reason for hiding this comment

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

This looks good to me. Let's just clarify one thing in the test and then I think it'll be good to merge.

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting review Awaiting review labels Sep 25, 2023
@github-actions github-actions bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Sep 25, 2023
@CurtHagenlocher CurtHagenlocher merged commit ded3295 into apache:main Oct 16, 2023
9 checks passed
@spanglerco spanglerco deleted the csharp/get-string-empty branch October 16, 2023 18:34
@conbench-apache-arrow
Copy link

After merging your PR, Conbench analyzed the 5 benchmarking runs that have been run so far on merge-commit ded3295.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 1 possible false positive for unstable benchmarks that are known to sometimes produce them.

JerAguilon pushed a commit to JerAguilon/arrow that referenced this pull request Oct 23, 2023
… of empty (apache#37862)

### Rationale for this change

Fixes apache#37861.

### What changes are included in this PR?

Add `BinaryArray.GetBytes(int, out bool)` overload that enables
`StringArray.GetString` to reliably determine if the value is null or
empty without needing an additional call to `IsNull`.

### Are these changes tested?

Added a test for `StringArray.GetString` (which didn't appear to have
any existing tests). Two of the cases fail without this change. I also
updated the tests that call `BinaryArray.GetBytes` to use the new
overload instead of a separate call to `IsNull` as extra validation.

### Are there any user-facing changes?

New public overload to an existing API.
* Closes: apache#37861
loicalleyne pushed a commit to loicalleyne/arrow that referenced this pull request Nov 13, 2023
… of empty (apache#37862)

### Rationale for this change

Fixes apache#37861.

### What changes are included in this PR?

Add `BinaryArray.GetBytes(int, out bool)` overload that enables
`StringArray.GetString` to reliably determine if the value is null or
empty without needing an additional call to `IsNull`.

### Are these changes tested?

Added a test for `StringArray.GetString` (which didn't appear to have
any existing tests). Two of the cases fail without this change. I also
updated the tests that call `BinaryArray.GetBytes` to use the new
overload instead of a separate call to `IsNull` as extra validation.

### Are there any user-facing changes?

New public overload to an existing API.
* Closes: apache#37861
dgreiss pushed a commit to dgreiss/arrow that referenced this pull request Feb 19, 2024
… of empty (apache#37862)

### Rationale for this change

Fixes apache#37861.

### What changes are included in this PR?

Add `BinaryArray.GetBytes(int, out bool)` overload that enables
`StringArray.GetString` to reliably determine if the value is null or
empty without needing an additional call to `IsNull`.

### Are these changes tested?

Added a test for `StringArray.GetString` (which didn't appear to have
any existing tests). Two of the cases fail without this change. I also
updated the tests that call `BinaryArray.GetBytes` to use the new
overload instead of a separate call to `IsNull` as extra validation.

### Are there any user-facing changes?

New public overload to an existing API.
* Closes: apache#37861
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[C#] StringArray.GetString returns null if every value is empty
3 participants