Open jliu0812 opened 2 months ago
Testing locally, by changing the following line (https://github.com/getmoto/py-partiql-parser/blob/main/py_partiql_parser/_internal/parser.py#L108)
from
source_data = self.documents[list(from_parser.clauses.values())[0].lower()]
to
source_data = self.documents[list(from_parser.clauses.values())[0]]
Fixes the problem.
Expected result:
{'Items': [{'pk': {'S': 'test'}, 'sk': {'S': 'test1'}}, {'pk': {'S': 'test2'}, 'sk': {'S': 'test2'}}], 'ResponseMetadata': {'RequestId': 'ycN6ilzvV30CTS3W1us16BLMKf9iphbpg6sYPZVrdQ9uOoBJA4sJ', 'HTTPStatusCode': 200, 'HTTPHeaders': {'server': 'amazon.com', 'date': 'Thu, 05 Sep 2024 16:42:24 GMT', 'x-amzn-requestid': 'ycN6ilzvV30CTS3W1us16BLMKf9iphbpg6sYPZVrdQ9uOoBJA4sJ', 'x-amz-crc32': '2096729874'}, 'RetryAttempts': 0}}
Hi @jliu0812, I think that was a holdover from when we were using the same approach for DynamoDB and S3, and in S3 the 'tablename' (i.e. s3object
) is case-insensitive.
This is now fixed with 0.5.6
, just released. Can you upgrade and verify it now works for you?
When a DynamoDB table has mixed cases, the parser throws a KeyError message.
How to reproduce: Run the following code:
Traceback log: