chainlit icon indicating copy to clipboard operation
chainlit copied to clipboard

Fix: DynamoDB Typeerror with AWS Bedrock

Open munday-tech opened this issue 1 year ago • 10 comments

When using AWS Bedrock, _update_item throws a TypeError as AWS Bedrock returns floats in its response. Dynamodb requires floats to be provided as Decimal. The reverse can also occur if you call get_thread from anywhere in code, as Decimal is not JSON serializable.

The issue can be seen here #1116

I have added two new functions within DynamoDBDataLater that converts floats to decimals and decimals to floats, calling each function from _update_item and get_thread respectively. This change resolves the TypeErrors.

munday-tech avatar Jul 25 '24 08:07 munday-tech

Diffs LGTM. Next step is to get it past pipeline and for @willydouhard / @tpatel / team to test and approve.

mayaankvad avatar Jul 28 '24 16:07 mayaankvad

Anything you need from me to progress this @mayaankvad ?

munday-tech avatar Aug 01 '24 12:08 munday-tech

No, I think the changes look good. Now it needs @willydouhard / teams approval

mayaankvad avatar Aug 02 '24 22:08 mayaankvad

Seems like mypy is failing @munday-tech

willydouhard avatar Aug 06 '24 09:08 willydouhard

Are you able to make this fix @munday-tech?

mayaankvad avatar Aug 10 '24 13:08 mayaankvad

Will get it done asap

munday-tech avatar Aug 12 '24 04:08 munday-tech

@willydouhard @mayaankvad should be good now.

munday-tech avatar Aug 12 '24 10:08 munday-tech

Any updates on this one? Looking forward to this being merged

antoniordz96 avatar Aug 27 '24 14:08 antoniordz96

Looks ok to me.

mayaankvad avatar Aug 29 '24 13:08 mayaankvad

I am waiting for this one to be merged

karthikvarmak1 avatar Sep 26 '24 12:09 karthikvarmak1

Also waiting on this to be merged - would someone be able to add the required changes so it can be done soon please?

liv-watson avatar Oct 30 '24 17:10 liv-watson

any news about this?

nestorcolt avatar Nov 19 '24 21:11 nestorcolt

Also needing this to be merged.

thiagotps avatar Dec 06 '24 14:12 thiagotps