Skip to content

Commit

Permalink
MINOR: [Swift] Add missing Bool type to decoder type checks (apache#4…
Browse files Browse the repository at this point in the history
…2064)

### What changes are included in this PR?

Adding Bool and Bool? as valid types for decoding.

Authored-by: Alva Bandy <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
  • Loading branch information
abandy authored Jun 10, 2024
1 parent f2057c5 commit 32db3dd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion swift/Arrow/Sources/Arrow/ArrowDecoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ private struct ArrowUnkeyedDecoding: UnkeyedDecodingContainer {
type == UInt32?.self || type == UInt64?.self ||
type == String?.self || type == Double?.self ||
type == Float?.self || type == Date?.self ||
type == Bool?.self || type == Bool.self ||
type == Int8.self || type == Int16.self ||
type == Int32.self || type == Int64.self ||
type == UInt8.self || type == UInt16.self ||
Expand Down Expand Up @@ -359,7 +360,8 @@ private struct ArrowSingleValueDecoding: SingleValueDecodingContainer {
type == UInt8.self || type == UInt16.self ||
type == UInt32.self || type == UInt64.self ||
type == String.self || type == Double.self ||
type == Float.self || type == Date.self {
type == Float.self || type == Date.self ||
type == Bool.self {
return try self.decoder.doDecode(0)!
} else {
throw ArrowError.invalid("Type \(type) is currently not supported")
Expand Down

0 comments on commit 32db3dd

Please sign in to comment.