10000 feat: add user_agent to client by jackwotherspoon · Pull Request #17 · googleapis/langchain-google-cloud-sql-mssql-python · GitHub
[go: up one dir, main page]

Skip to content

feat: add user_agent to client #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading 8000
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies = [
"langchain==0.1.1",
"SQLAlchemy==2.0.7",
"sqlalchemy-pytds==0.3.5",
"cloud-sql-python-connector[pytds]==1.5.0"
"cloud-sql-python-connector[pytds]==1.7.0"
]

[tool.setuptools.dynamic]
Expand Down
6 changes: 5 additions & 1 deletion src/langchain_google_cloud_sql_mssql/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
import sqlalchemy
from google.cloud.sql.connector import Connector

from .version import __version__

USER_AGENT = "langchain-google-cloud-sql-mssql-python/" + __version__


class MSSQLEngine:
"""A class for managing connections to a Cloud SQL for MSSQL database."""
Expand Down Expand Up @@ -92,7 +96,7 @@ def _create_connector_engine(
Python Connector.
"""
if cls._connector is None:
cls._connector = Connector()
cls._connector = Connector(user_agent=USER_AGENT)

# anonymous function to be used for SQLAlchemy 'creator' argument
def getconn():
Expand Down
0