Skip to content

Commit

Permalink
chore: remove close and raise errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jackwotherspoon committed Jan 26, 2024
1 parent b579491 commit 5115207
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
8 changes: 1 addition & 7 deletions src/langchain_google_cloud_sql_mysql/mysql_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def _get_iam_principal_email(
# call OAuth2 api to get IAM principal email associated with OAuth2 token
url = f"https://oauth2.googleapis.com/tokeninfo?access_token={credentials.token}"
response = requests.get(url)
response.raise_for_status()
response_json: Dict = response.json()
email = response_json.get("email")
if email is None:
Expand All @@ -72,13 +73,6 @@ def __init__(
) -> None:
self.engine = engine

def close(self) -> None:
"""Utility method for closing the Cloud SQL Python Connector
background tasks.
"""
if MySQLEngine._connector:
MySQLEngine._connector.close()

@classmethod
def from_instance(
cls,
Expand Down
1 change: 0 additions & 1 deletion tests/integration/test_mysql_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def setup() -> Generator:
with engine.connect() as conn:
conn.execute(sqlalchemy.text(f"DROP TABLE IF EXISTS `{table_name}`"))
conn.commit()
engine.close()


def test_load_from_query(engine):
Expand Down

0 comments on commit 5115207

Please sign in to comment.