jorisvandenbossche commented on code in PR #42098:
URL: https://github.com/apache/arrow/pull/42098#discussion_r1637664643
##########
python/pyarrow/src/arrow/python/ipc.cc:
##########
@@ -79,7 +79,8 @@ Status
CastingRecordBatchReader::Init(std::shared_ptr<RecordBatchReader> parent,
// Ensure all columns can be cast before succeeding
for (int i = 0; i < num_fields; i++) {
- if (!compute::CanCast(*src->field(i)->type(), *schema->field(i)->type())) {
+ if ((!((src->field(i)->type()->Equals(schema->field(i)->type())))) &&
+ (!compute::CanCast(*src->field(i)->type(),
*schema->field(i)->type()))) {
Review Comment:
> we shouldn't have the T->T cast functions in the table.
We do have that for some, though, like boolean:
https://github.com/apache/arrow/blob/baf4089eaa84b2a5c2cb437f3a249f83577dbc29/cpp/src/arrow/compute/kernels/scalar_cast_boolean.cc#L50-L53
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]