Skip to content

Commit cb1e416

Browse files
committed
[MINOR] Fix build warnings
### What changes were proposed in this pull request? This PR aims to clean up build warnings. ### Why are the changes needed? **BEFORE** ``` $ swift build | grep warning /Users/dongjoon/APACHE/spark-connect-swift/Sources/SparkConnect/ArrowReader.swift:301:27: warning: 'as' test is always true | `- warning: 'as' test is always true /Users/dongjoon/APACHE/spark-connect-swift/Sources/SparkConnect/ArrowReader.swift:364:25: warning: 'as' test is always true | `- warning: 'as' test is always true /Users/dongjoon/APACHE/spark-connect-swift/Sources/SparkConnect/ArrowReader.swift:301:27: warning: 'as' test is always true | `- warning: 'as' test is always true /Users/dongjoon/APACHE/spark-connect-swift/Sources/SparkConnect/ArrowReader.swift:364:25: warning: 'as' test is always true | `- warning: 'as' test is always true /Users/dongjoon/APACHE/spark-connect-swift/Sources/SparkConnect/ArrowReader.swift:301:27: warning: 'as' test is always true | `- warning: 'as' test is always true /Users/dongjoon/APACHE/spark-connect-swift/Sources/SparkConnect/ArrowReader.swift:364:25: warning: 'as' test is always true | `- warning: 'as' test is always true ``` **AFTER** ``` $ swift build | grep warning ``` ### Does this PR introduce _any_ user-facing change? A code cleanup. ### How was this patch tested? Manual review. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #31 from dongjoon-hyun/minor. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent c03cbfe commit cb1e416

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

Sources/SparkConnect/ArrowReader.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,8 @@ public class ArrowReader { // swiftlint:disable:this type_body_length
298298
messageEndOffset: messageEndOffset
299299
).get()
300300
result.batches.append(recordBatch)
301-
} catch let error as ArrowError {
301+
} catch let error {
302302
return .failure(error)
303-
} catch {
304-
return .failure(.unknownError("Unexpected error: \(error)"))
305303
}
306304
default:
307305
return .failure(.unknownError("Unhandled header type: \(message.headerType)"))
@@ -361,10 +359,8 @@ public class ArrowReader { // swiftlint:disable:this type_body_length
361359
).get()
362360
result.batches.append(recordBatch)
363361
return .success(())
364-
} catch let error as ArrowError {
362+
} catch let error {
365363
return .failure(error)
366-
} catch {
367-
return .failure(.unknownError("Unexpected error: \(error)"))
368364
}
369365

370366
default:

Tests/SparkConnectTests/RuntimeConfTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ struct RuntimeConfTests {
3131
_ = try await client.connect(UUID().uuidString)
3232
let conf = RuntimeConf(client)
3333

34-
#expect(try await conf.get("spark.app.name") != nil)
34+
#expect(try await !conf.get("spark.app.name").isEmpty)
3535

3636
try await #require(throws: Error.self) {
3737
try await conf.get("spark.test.non-exist")

0 commit comments

Comments
 (0)