1212from langchain_astradb .utils .astradb import SetupMode
1313
1414from .conftest import (
15- COLLECTION_NAME_IDXALL ,
1615 AstraDBCredentials ,
1716 astra_db_env_vars_available ,
1817)
2120@pytest .fixture
2221def history1 (
2322 astra_db_credentials : AstraDBCredentials ,
24- empty_collection_idxall : Collection , # noqa: ARG001
23+ empty_collection_idxall : Collection ,
2524) -> AstraDBChatMessageHistory :
2625 return AstraDBChatMessageHistory (
2726 session_id = "session-test-1" ,
28- collection_name = COLLECTION_NAME_IDXALL ,
27+ collection_name = empty_collection_idxall . name ,
2928 token = astra_db_credentials ["token" ],
3029 api_endpoint = astra_db_credentials ["api_endpoint" ],
3130 namespace = astra_db_credentials ["namespace" ],
@@ -36,11 +35,11 @@ def history1(
3635@pytest .fixture
3736def history2 (
3837 astra_db_credentials : AstraDBCredentials ,
39- history1 : AstraDBChatMessageHistory , # noqa: ARG001
38+ history1 : AstraDBChatMessageHistory ,
4039) -> AstraDBChatMessageHistory :
4140 return AstraDBChatMessageHistory (
4241 session_id = "session-test-2" ,
43- collection_name = COLLECTION_NAME_IDXALL ,
42+ collection_name = history1 . collection_name ,
4443 token = astra_db_credentials ["token" ],
4544 api_endpoint = astra_db_credentials ["api_endpoint" ],
4645 namespace = astra_db_credentials ["namespace" ],
@@ -54,11 +53,11 @@ def history2(
5453@pytest .fixture
5554async def async_history1 (
5655 astra_db_credentials : AstraDBCredentials ,
57- history1 : AstraDBChatMessageHistory , # noqa: ARG001
56+ history1 : AstraDBChatMessageHistory ,
5857) -> AstraDBChatMessageHistory :
5958 return AstraDBChatMessageHistory (
6059 session_id = "async-session-test-1" ,
61- collection_name = COLLECTION_NAME_IDXALL ,
60+ collection_name = history1 . collection_name ,
6261 token = astra_db_credentials ["token" ],
6362 api_endpoint = astra_db_credentials ["api_endpoint" ],
6463 namespace = astra_db_credentials ["namespace" ],
@@ -70,11 +69,11 @@ async def async_history1(
7069@pytest .fixture
7170async def async_history2 (
7271 astra_db_credentials : AstraDBCredentials ,
73- history1 : AstraDBChatMessageHistory , # noqa: ARG001
72+ history1 : AstraDBChatMessageHistory ,
7473) -> AstraDBChatMessageHistory :
7574 return AstraDBChatMessageHistory (
7675 session_id = "async-session-test-2" ,
77- collection_name = COLLECTION_NAME_IDXALL ,
76+ collection_name = history1 . collection_name ,
7877 token = astra_db_credentials ["token" ],
7978 api_endpoint = astra_db_credentials ["api_endpoint" ],
8079 namespace = astra_db_credentials ["namespace" ],
@@ -208,13 +207,13 @@ def test_chatmsh_coreclients_init_sync(
208207 self ,
209208 astra_db_credentials : AstraDBCredentials ,
210209 core_astra_db : AstraDB ,
211- empty_collection_idxall : Collection , # noqa: ARG002
210+ empty_collection_idxall : Collection ,
212211 ) -> None :
213212 """A deprecation warning from passing a (core) AstraDB, but it works."""
214213 test_messages = [AIMessage (content = "Meow." )]
215214 chatmh_init_ok = AstraDBChatMessageHistory (
216215 session_id = "gattini" ,
217- collection_name = COLLECTION_NAME_IDXALL ,
216+ collection_name = empty_collection_idxall . name ,
218217 token = astra_db_credentials ["token" ],
219218 api_endpoint = astra_db_credentials ["api_endpoint" ],
220219 namespace = astra_db_credentials ["namespace" ],
@@ -224,7 +223,7 @@ def test_chatmsh_coreclients_init_sync(
224223 # create an equivalent cache with core AstraDB in init
225224 with pytest .warns (DeprecationWarning ) as rec_warnings :
226225 chatmh_init_core = AstraDBChatMessageHistory (
227- collection_name = COLLECTION_NAME_IDXALL ,
226+ collection_name = empty_collection_idxall . name ,
228227 session_id = "gattini" ,
229228 astra_db_client = core_astra_db ,
230229 )
@@ -242,13 +241,13 @@ async def test_chatmsh_coreclients_init_async(
242241 self ,
243242 astra_db_credentials : AstraDBCredentials ,
244243 core_astra_db : AstraDB ,
245- empty_collection_idxall : Collection , # noqa: ARG002
244+ empty_collection_idxall : Collection ,
246245 ) -> None :
247246 """A deprecation warning from passing a (core) AstraDB, but it works."""
248247 test_messages = [AIMessage (content = "Ameow." )]
249248 chatmh_init_ok = AstraDBChatMessageHistory (
250249 session_id = "gattini" ,
251- collection_name = COLLECTION_NAME_IDXALL ,
250+ collection_name = empty_collection_idxall . name ,
252251 token = astra_db_credentials ["token" ],
253252 api_endpoint = astra_db_credentials ["api_endpoint" ],
254253 namespace = astra_db_credentials ["namespace" ],
@@ -258,7 +257,7 @@ async def test_chatmsh_coreclients_init_async(
258257 # create an equivalent cache with core AstraDB in init
259258 with pytest .warns (DeprecationWarning ) as rec_warnings :
260259 chatmh_init_core = AstraDBChatMessageHistory (
261- collection_name = COLLECTION_NAME_IDXALL ,
260+ collection_name = empty_collection_idxall . name ,
262261 session_id = "gattini" ,
263262 astra_db_client = core_astra_db ,
264263 setup_mode = SetupMode .ASYNC ,
0 commit comments