lidavidm commented on code in PR #81:
URL: https://github.com/apache/arrow-nanoarrow/pull/81#discussion_r1041075423
##########
src/nanoarrow/schema.c:
##########
@@ -281,27 +301,67 @@ ArrowErrorCode ArrowSchemaInitDateTime(struct
ArrowSchema* schema,
break;
case NANOARROW_TYPE_DURATION:
if (timezone != NULL) {
- schema->release(schema);
return EINVAL;
}
n_chars = snprintf(buffer, sizeof(buffer), "tD%s", time_unit_str);
break;
default:
- schema->release(schema);
return EINVAL;
}
if (((size_t)n_chars) >= sizeof(buffer)) {
- schema->release(schema);
return ERANGE;
}
buffer[n_chars] = '\0';
- result = ArrowSchemaSetFormat(schema, buffer);
- if (result != NANOARROW_OK) {
- schema->release(schema);
- return result;
+ return ArrowSchemaSetFormat(schema, buffer);
+}
+
+ArrowErrorCode ArrowSchemaSetTypeUnion(struct ArrowSchema* schema,
+ enum ArrowType data_type, int64_t
n_children) {
+ if (n_children < 1 || n_children > 127) {
Review Comment:
https://github.com/apache/arrow/issues/14855
--
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]