Skip to content

Commit

Permalink
Set charset on connection from AIO pool.
Browse files Browse the repository at this point in the history
  • Loading branch information
tjni committed Dec 8, 2024
1 parent d6089b1 commit 2792a53
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions langgraph/checkpoint/mysql/aio.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ async def _get_connection(
yield conn
elif isinstance(conn, aiomysql.Pool):
async with conn.acquire() as _conn:
# This seems necessary until https://github.com/PyMySQL/PyMySQL/pull/1119
# is merged into aiomysql.
await _conn.set_charset(pymysql.connections.DEFAULT_CHARSET)
yield _conn
else:
raise TypeError(f"Invalid connection type: {type(conn)}")
Expand Down

0 comments on commit 2792a53

Please sign in to comment.