@@ -30,7 +30,7 @@ namespace Apache.Arrow.Adbc.Tests.Drivers.Apache.Spark
3030 public class SparkHttpConnectionUserAgentTest
3131 {
3232 [ Fact ]
33- public void UserAgentEntry_WhenNotProvided_UsesBaseUserAgent ( )
33+ public void UserAgentEntry_WhenNotProvided_UsesBaseUserAgentWithThrift ( )
3434 {
3535 // Arrange
3636 var properties = new Dictionary < string , string >
@@ -45,7 +45,7 @@ public void UserAgentEntry_WhenNotProvided_UsesBaseUserAgent()
4545 string userAgent = GetUserAgentFromConnection ( properties ) ;
4646
4747 // Assert
48- Assert . Equal ( "ADBCSparkDriver/1.0.0 " , userAgent ) ;
48+ Assert . Matches ( @ "ADBCSparkDriver/[\d\.]+ Thrift(/[\d\.]+)? ", userAgent ) ;
4949 }
5050
5151 [ Fact ]
@@ -65,7 +65,7 @@ public void UserAgentEntry_WhenProvided_AppendsToBaseUserAgent()
6565 string userAgent = GetUserAgentFromConnection ( properties ) ;
6666
6767 // Assert
68- Assert . Equal ( "ADBCSparkDriver/1.0.0 PowerBI" , userAgent ) ;
68+ Assert . Matches ( @ "ADBCSparkDriver/[\d\.]+ Thrift(/[\d\.]+)? PowerBI", userAgent ) ;
6969 }
7070
7171 [ Fact ]
@@ -85,7 +85,7 @@ public void UserAgentEntry_WhenEmpty_UsesBaseUserAgent()
8585 string userAgent = GetUserAgentFromConnection ( properties ) ;
8686
8787 // Assert
88- Assert . Equal ( "ADBCSparkDriver/1.0.0 " , userAgent ) ;
88+ Assert . Matches ( @ "ADBCSparkDriver/[\d\.]+ Thrift(/[\d\.]+)? ", userAgent ) ;
8989 }
9090
9191 [ Fact ]
@@ -105,7 +105,26 @@ public void UserAgentEntry_WhenWhitespace_UsesBaseUserAgent()
105105 string userAgent = GetUserAgentFromConnection ( properties ) ;
106106
107107 // Assert
108- Assert . Equal ( "ADBCSparkDriver/1.0.0" , userAgent ) ;
108+ Assert . Matches ( @"ADBCSparkDriver/[\d\.]+ Thrift(/[\d\.]+)?" , userAgent ) ;
109+ }
110+
111+ [ Fact ]
112+ public void UserAgent_IncludesThriftComponent ( )
113+ {
114+ // Arrange
115+ var properties = new Dictionary < string , string >
116+ {
117+ [ SparkParameters . Type ] = SparkServerTypeConstants . Http ,
118+ [ SparkParameters . HostName ] = "valid.server.com" ,
119+ [ SparkParameters . Path ] = "/path" ,
120+ [ SparkParameters . AuthType ] = SparkAuthTypeConstants . None
121+ } ;
122+
123+ // Act
124+ string userAgent = GetUserAgentFromConnection ( properties ) ;
125+
126+ // Assert
127+ Assert . Contains ( "Thrift" , userAgent ) ;
109128 }
110129
111130 private string GetUserAgentFromConnection ( Dictionary < string , string > properties )
0 commit comments