Skip to content

Commit a098d00

Browse files
chore: update naming for consistency (#11)
1 parent b90a9bb commit a098d00

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/langchain_google_cloud_sql_mssql/mssql_chat_message_history.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def __init__(
4747
def _verify_schema(self) -> None:
4848
"""Verify table exists with required schema for MSSQLChatMessageHistory class.
4949
50-
Use helper method MSSQLEngine.create_chat_history_table(...) to create
50+
Use helper method MSSQLEngine.init_chat_history_table(...) to create
5151
table with valid schema.
5252
"""
5353
insp = sqlalchemy.inspect(self.engine.engine)
@@ -74,7 +74,7 @@ def _verify_schema(self) -> None:
7474
raise AttributeError(
7575
f"Table '{self.table_name}' does not exist. Please create "
7676
"it before initializing MSSQLChatMessageHistory. See "
77-
"MSSQLEngine.create_chat_history_table() for a helper method."
77+
"MSSQLEngine.init_chat_history_table() for a helper method."
7878
)
7979

8080
@property

src/langchain_google_cloud_sql_mssql/mssql_engine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def connect(self) -> sqlalchemy.engine.Connection:
119119
"""
120120
return self.engine.connect()
121121

122-
def create_chat_history_table(self, table_name: str) -> None:
122+
def init_chat_history_table(self, table_name: str) -> None:
123123
"""Create table with schema required for MSSQLChatMessageHistory class.
124124
125125
Required schema is as follows:

tests/integration/test_mssql_chat_message_history.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def setup() -> Generator:
5959

6060

6161
def test_chat_message_history(memory_engine: MSSQLEngine) -> None:
62-
memory_engine.create_chat_history_table(table_name)
62+
memory_engine.init_chat_history_table(table_name)
6363
history = MSSQLChatMessageHistory(
6464
engine=memory_engine, session_id="test", table_name=table_name
6565
)
@@ -87,7 +87,7 @@ def test_chat_message_history_table_does_not_exist(memory_engine: MSSQLEngine) -
8787
# assert custom error message for missing table
8888
assert (
8989
exc_info.value.args[0]
90-
== f"Table 'missing_table' does not exist. Please create it before initializing MSSQLChatMessageHistory. See MSSQLEngine.create_chat_history_table() for a helper method."
90+
== f"Table 'missing_table' does not exist. Please create it before initializing MSSQLChatMessageHistory. See MSSQLEngine.init_chat_history_table() for a helper method."
9191
)
9292

9393

0 commit comments

Comments
 (0)