fix: Relax comparison strictness such that integration tests pass#399
Merged
paleolimbot merged 16 commits intoapache:mainfrom Apr 15, 2024
Merged
fix: Relax comparison strictness such that integration tests pass#399paleolimbot merged 16 commits intoapache:mainfrom
paleolimbot merged 16 commits intoapache:mainfrom
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #399 +/- ##
==========================================
+ Coverage 88.76% 88.80% +0.03%
==========================================
Files 82 82
Lines 14633 14685 +52
==========================================
+ Hits 12989 13041 +52
Misses 1644 1644 ☔ View full report in Codecov by Sentry. |
f5d8c46 to
fc2afa2
Compare
627fda1 to
ab969ce
Compare
benibus
reviewed
Apr 5, 2024
| ArrowStringView key, value; | ||
| while (reader.remaining_keys > 0) { | ||
| NANOARROW_RETURN_NOT_OK(ArrowMetadataReaderRead(&reader, &key, &value)); | ||
| out->insert({std::string(key.data, key.size_bytes), |
There was a problem hiding this comment.
Just to be sure, can we safely rule out the possibility of duplicate keys by this point?
Member
Author
There was a problem hiding this comment.
Great catch! I will workshop this...
Member
Author
There was a problem hiding this comment.
Ok! I now check for duplicate keys, although technically the comparison will just fail if this happens. The real solution is probably to fix the Java implementation to stop reordering metadata and add test cases for this in the archery data generator.
CurtHagenlocher
pushed a commit
to apache/arrow
that referenced
this pull request
Apr 7, 2024
…e Arrays (#41054) ### Rationale for this change When implementing integration tests for nanoarrow, it was observed that C# never released arrays where `array->buffers[i]` was `NULL` (including any buffers of any recursive child arrays). This is allowed ( https://arrow.apache.org/docs/format/CDataInterface.html#c.ArrowArray.buffers ); however, every other implementation appears to allocate even for length zero buffers (including nanoarrow after apache/arrow-nanoarrow#399 ). ### What changes are included in this PR? `AddMemory()` is replaced with `ArrowBuffer.Empty` if the length of the imported buffer would have been 0 bytes. For other buffers (or anywhere I saw dereferencing a buffer pointer), I added a `Debug.Assert` just to be sure. ### Are these changes tested? I'm not sure what the best way to test them is! They won't be tested in the nanoarrow integration tests since at the point that they run, nanoarrow will no longer export arrays that would trigger this. ### Are there any user-facing changes? No * GitHub Issue: #40898 Authored-by: Dewey Dunnington <dewey@fishandwhistle.net> Signed-off-by: Curt Hagenlocher <curt@hagenlocher.org>
vibhatha
pushed a commit
to vibhatha/arrow
that referenced
this pull request
May 25, 2024
…terface Arrays (apache#41054) ### Rationale for this change When implementing integration tests for nanoarrow, it was observed that C# never released arrays where `array->buffers[i]` was `NULL` (including any buffers of any recursive child arrays). This is allowed ( https://arrow.apache.org/docs/format/CDataInterface.html#c.ArrowArray.buffers ); however, every other implementation appears to allocate even for length zero buffers (including nanoarrow after apache/arrow-nanoarrow#399 ). ### What changes are included in this PR? `AddMemory()` is replaced with `ArrowBuffer.Empty` if the length of the imported buffer would have been 0 bytes. For other buffers (or anywhere I saw dereferencing a buffer pointer), I added a `Debug.Assert` just to be sure. ### Are these changes tested? I'm not sure what the best way to test them is! They won't be tested in the nanoarrow integration tests since at the point that they run, nanoarrow will no longer export arrays that would trigger this. ### Are there any user-facing changes? No * GitHub Issue: apache#40898 Authored-by: Dewey Dunnington <dewey@fishandwhistle.net> Signed-off-by: Curt Hagenlocher <curt@hagenlocher.org>
kou
pushed a commit
to apache/arrow-dotnet
that referenced
this pull request
Jul 30, 2025
…e Arrays (#41054) ### Rationale for this change When implementing integration tests for nanoarrow, it was observed that C# never released arrays where `array->buffers[i]` was `NULL` (including any buffers of any recursive child arrays). This is allowed ( https://arrow.apache.org/docs/format/CDataInterface.html#c.ArrowArray.buffers ); however, every other implementation appears to allocate even for length zero buffers (including nanoarrow after apache/arrow-nanoarrow#399 ). ### What changes are included in this PR? `AddMemory()` is replaced with `ArrowBuffer.Empty` if the length of the imported buffer would have been 0 bytes. For other buffers (or anywhere I saw dereferencing a buffer pointer), I added a `Debug.Assert` just to be sure. ### Are these changes tested? I'm not sure what the best way to test them is! They won't be tested in the nanoarrow integration tests since at the point that they run, nanoarrow will no longer export arrays that would trigger this. ### Are there any user-facing changes? No * GitHub Issue: #40898 Authored-by: Dewey Dunnington <dewey@fishandwhistle.net> Signed-off-by: Curt Hagenlocher <curt@hagenlocher.org>
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.
These changes are the changes required such that apache/arrow#39302 results in passing integration tests for nanoarrow. The changes are mostly related to comparison: