Skip to content

Commit

Permalink
fix platform detection logic (#2234)
Browse files Browse the repository at this point in the history
Co-authored-by: cruise <[email protected]>
  • Loading branch information
lhrotk and mslhrotk authored Jun 15, 2024
1 parent 91e552c commit 440f18e
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ object PlatformDetails {
def currentPlatform(): String = {
val azureService = sys.env.get("AZURE_SERVICE")
azureService match {
case _ if new java.io.File("/home/trusted-service-user/.trident-context").exists() => PlatformSynapseInternal
// Note Below judgement doesn't work if you are not in main thread
// In Fabric, existence of above file should always gives right judgement
// In Synapse, hitting below condition has risks.
case Some(serviceName) if serviceName == SynapseProjectName =>
defineSynapsePlatform()
case _ if new java.io.File("/dbfs").exists() => PlatformDatabricks
case _ if new java.io.File("/home/trusted-service-user/.trident-context").exists() => PlatformSynapseInternal
case _ if sys.env.contains("BINDER_LAUNCH_HOST") => PlatformBinder
case _ => PlatformUnknown
}
Expand Down

0 comments on commit 440f18e

Please sign in to comment.