Skip to content
This repository was archived by the owner on Mar 13, 2026. It is now read-only.

Commit fec1974

Browse files
authored
refactor: update default user agent header to match convention (#164)
Co-authored-by: larkee <larkee@users.noreply.github.com>
1 parent 25beeaa commit fec1974

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

google/cloud/sqlalchemy_spanner/sqlalchemy_spanner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ def create_connect_args(self, url):
549549
dist = pkg_resources.get_distribution("sqlalchemy-spanner")
550550
return (
551551
[match.group("instance"), match.group("database"), match.group("project")],
552-
{"user_agent": dist.project_name + "/" + dist.version},
552+
{"user_agent": f"gl-{dist.project_name}/{dist.version}"},
553553
)
554554

555555
@engine_to_connection

test/test_suite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1575,7 +1575,7 @@ def test_user_agent(self):
15751575
with self._engine.connect() as connection:
15761576
assert (
15771577
connection.connection.instance._client._client_info.user_agent
1578-
== dist.project_name + "/" + dist.version
1578+
== f"gl-{dist.project_name}/{dist.version}"
15791579
)
15801580

15811581

0 commit comments

Comments
 (0)