mgrazianoc commented on code in PR #33:
URL: https://github.com/apache/arrow-swift/pull/33#discussion_r2150326362
##########
Arrow/Sources/Arrow/ProtoUtil.swift:
##########
@@ -64,6 +64,22 @@ func fromProto( // swiftlint:disable:this
cyclomatic_complexity function_body_le
let arrowUnit: ArrowTime64Unit = timeType.unit == .microsecond ?
.microseconds : .nanoseconds
arrowType = ArrowTypeTime64(arrowUnit)
}
+ case .timestamp:
+ let timestampType = field.type(type:
org_apache_arrow_flatbuf_Timestamp.self)!
+ let arrowUnit: ArrowTimestampUnit
+ switch timestampType.unit {
+ case .second:
+ arrowUnit = .seconds
+ case .millisecond:
+ arrowUnit = .milliseconds
+ case .microsecond:
+ arrowUnit = .microseconds
+ case .nanosecond:
+ arrowUnit = .nanoseconds
+ }
+
+ let timezone = timestampType.timezone
+ arrowType = ArrowTypeTimestamp(arrowUnit, timezone: timezone?.isEmpty
== true ? nil : timezone)
Review Comment:
Unfortunately, `isEmpty` may be called in a `nil` value, thus it can be
something else then `true` or `false`.
--
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]