We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
iOS
watchOS
tvOS
1 parent 085c3ef commit 3b77f49Copy full SHA for 3b77f49
Sources/SparkConnect/SparkSession.swift
@@ -45,7 +45,13 @@ public actor SparkSession {
45
/// - userID: an optional user ID. If absent, `SPARK_USER` environment or ``ProcessInfo.processInfo.userName`` is used.
46
init(_ connection: String, _ userID: String? = nil) {
47
let processInfo = ProcessInfo.processInfo
48
+#if os(iOS) || os(watchOS) || os(tvOS)
49
+ let userName = processInfo.environment["SPARK_USER"] ?? ""
50
+#elseif os(macOS) || os(Linux)
51
let userName = processInfo.environment["SPARK_USER"] ?? processInfo.userName
52
+#else
53
+ assert(false, "Unsupported platform")
54
+#endif
55
self.client = SparkConnectClient(remote: connection, user: userID ?? userName)
56
self.conf = RuntimeConf(self.client)
57
}
0 commit comments