Skip to content

Conversation

@toddmeng-db
Copy link
Contributor

@toddmeng-db toddmeng-db commented Apr 17, 2025

Enables user agent entry to be passed via SparkParameters, such as "user_agent_entry = PowerBi".
Also adds Thrift version to user agent header

Verified in Databricks HTTP Logs for the user agent:
ADBCSparkDriver/1.0.0 Thrift/0.21.0 PowerBI

@lidavidm lidavidm changed the title Add user agent entry for spark http connections feat(csharp/src/Drivers/Apache/Spark): add user agent entry for spark http connections Apr 17, 2025
@eric-wang-1990
Copy link
Contributor

@toddmeng-db toddmeng-db force-pushed the add-user-agent-entry branch from 35dc2a4 to 0f70d05 Compare April 22, 2025 06:49
@toddmeng-db toddmeng-db force-pushed the add-user-agent-entry branch from 9c6119b to b1bb50d Compare April 22, 2025 06:57
@toddmeng-db toddmeng-db marked this pull request as ready for review April 22, 2025 16:59
@github-actions github-actions bot added this to the ADBC Libraries 18 milestone Apr 22, 2025
@toddmeng-db toddmeng-db changed the title feat(csharp/src/Drivers/Apache/Spark): add user agent entry for spark http connections feat(csharp/src/Drivers/Apache/Spark): add user agent entry + thrift version for spark http connections Apr 22, 2025
Copy link
Contributor

@CurtHagenlocher CurtHagenlocher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Can you mollify the linter by adding a final newline to the added test file and removing the trailing spaces from the others?

string userAgent = GetUserAgentFromConnection(properties);

// Assert
Assert.Matches(@"ADBCSparkDriver/[\d\.]+ Thrift(/[\d\.]+)?", userAgent);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are also trailing spaces somewhere around here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think they're fixed now? Thanks for giving me the headsup

Copy link
Contributor

@CurtHagenlocher CurtHagenlocher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@CurtHagenlocher CurtHagenlocher merged commit f74c8ff into apache:main Apr 22, 2025
7 checks passed
colin-rogers-dbt pushed a commit to dbt-labs/arrow-adbc that referenced this pull request Jun 10, 2025
…version for spark http connections (apache#2711)

Enables user agent entry to be passed via SparkParameters, such as
"user_agent_entry = PowerBi".
Also adds Thrift version to user agent header

Verified in Databricks HTTP Logs for the user agent:
ADBCSparkDriver/1.0.0 Thrift/0.21.0 PowerBI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants