mirror of
https://github.com/hwchase17/langchain
synced 2024-11-06 03:20:49 +00:00
fix(DynamoDBChatMessageHistory): correct delete_item method call (#10383)
**Description**: Fixed a bug introduced in version 0.0.281 in `DynamoDBChatMessageHistory` where `self.table.delete_item(self.key)` produced a TypeError: `TypeError: delete_item() only accepts keyword arguments`. Updated the method call to `self.table.delete_item(Key=self.key)` to resolve this issue. Please see also [the official AWS documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/table/delete_item.html#) on this **delete_item** method - only `**kwargs` are accepted. See also the PR, which introduced this bug: https://github.com/langchain-ai/langchain/pull/9896#discussion_r1317899073 Please merge this, I rely on this delete dynamodb item functionality (because of GDPR considerations). **Dependencies**: None **Tag maintainer**: @hwchase17 @joshualwhite **Twitter handle**: [@BenjaminLinnik](https://twitter.com/BenjaminLinnik) Co-authored-by: Benjamin Linnik <Benjamin@Linnik-IT.de>
This commit is contained in:
parent
30c9d97dda
commit
41047fe4c3
@ -121,6 +121,6 @@ class DynamoDBChatMessageHistory(BaseChatMessageHistory):
|
|||||||
) from e
|
) from e
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.table.delete_item(self.key)
|
self.table.delete_item(Key=self.key)
|
||||||
except ClientError as err:
|
except ClientError as err:
|
||||||
logger.error(err)
|
logger.error(err)
|
||||||
|
Loading…
Reference in New Issue
Block a user