Conversation
|
Many tests are failing now. |
4152f7a to
807b476
Compare
There was a problem hiding this comment.
Isn't a bit weird to have "Invalid: " twice in the message?
There was a problem hiding this comment.
It is, but this is the format of other child array validation failures (since the parent array's error message contains the child array's). Possibly a follow up issue is in order to simplify those; I think it'd be most valuable to provide a field path to the child which failed validation and the "leaf" error message.
There was a problem hiding this comment.
I didn't really delete it, just refactored its logic into NullArrayFactory. This way the code which requests preallocated zero buffer is in the same function as the code which uses the zero buffer, which seemed more clear to me.
pitrou
left a comment
There was a problem hiding this comment.
Some comments, questions and suggestions below.
The PR description should note that this is a behavior change.
2b2d779 to
d73aa0b
Compare
|
Getting merged and me rebasing the LIST_VIEW PR would be a good idea. |
d73aa0b to
b34ace5
Compare
|
|
||
| /// \brief The type of array used to represent this extension type's data | ||
| const std::shared_ptr<DataType>& storage_type() const { return storage_type_; } | ||
| std::shared_ptr<DataType> storage_type() const override { return storage_type_; } |
There was a problem hiding this comment.
Why not also override storage_type_ref?
There was a problem hiding this comment.
I intended to remove storage_type_ref altogether
| auto req = [](auto type) { return field("", std::move(type), /*nullable=*/false); }; | ||
|
|
||
| // union with no nullable fields cannot represent a null | ||
| ASSERT_RAISES(Invalid, MakeArrayOfNull(dense_union({req(int8())}), length)); |
There was a problem hiding this comment.
Shouldn't this be successful if length is 0?
There was a problem hiding this comment.
If the type cannot support any number of nulls, I would say that the special case of zero length is not worth allowing
|
Thank you for your contribution. Unfortunately, this |
ed3dd12 to
442342b
Compare
|
I'm going through old/abandoned PRs which would be advantageous to be able to merge and taking a look at ones which are mostly done and I can use AI to finish them off. This one looks mostly done so I did try to rebase and see how things look on CI. However, an AI review flagged up some missing things needed before merging, assuming the tests pass. Will paste below: Rebase notes: conflicts were all mechanical. Upstream renamed Findings from an AI review of the rebased diff. The first one I checked by hand and it's real. The rest I'm relaying as-is for whoever picks this up.
The one open design thread from the 2023 review is whether a zero-length array of a type that can't hold nulls should succeed (pitrou asked, bkietz preferred not to special-case it). |
|
Closing as stale, I don't have capacity to finish this off, but feel free to reopen if anyone is working on it. |
Rationale for this change
MakeArrayOfNulls didn't examine Field::nullable, so it could produce nested arrays whose children were null even if the schema said they couldn't have nulls. Additionally validation didn't look at Field::nullable so these malformed arrays don't fail tests.
Are these changes tested?
Yes, mostly by fixtures already in place.
Behavior
This PR includes breaking changes to public APIs.
The
Field::nullableflag is now enforce in array validation, so now (for example) an array with nulls which corresponds to a non nullable field will fail validation.