From cf8e560e4bfc503975dbf72d2e0a1e5af55f27fa Mon Sep 17 00:00:00 2001 From: Bert Blommers Date: Sat, 11 May 2024 18:59:24 +0000 Subject: [PATCH] DynamoDB: Update PyPartiqlParser version (#7683) --- moto/dynamodb/models/table_import.py | 9 +++------ setup.cfg | 18 +++++++++--------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/moto/dynamodb/models/table_import.py b/moto/dynamodb/models/table_import.py index 22e720312a04..905a70219efa 100644 --- a/moto/dynamodb/models/table_import.py +++ b/moto/dynamodb/models/table_import.py @@ -100,18 +100,15 @@ def _process_s3_files(self, s3_backend: "S3Backend", bucket: "FakeBucket") -> No max_keys=None, ) - from py_partiql_parser._internal.json_parser import JsonParser - - parser = JsonParser() + from py_partiql_parser import JsonParser for key in keys: if self.compression_type == "GZIP": content = gzip_decompress(key.value).decode("utf-8") else: content = key.value.decode("utf-8") - result = parser.parse(original=content) - if not isinstance(result, list): - result = [result] + result = JsonParser.parse(original=content) + for json_object in result: try: self.processed_count += 1 diff --git a/setup.cfg b/setup.cfg index 1594df76abdb..9892d8a51b03 100644 --- a/setup.cfg +++ b/setup.cfg @@ -54,7 +54,7 @@ all = openapi-spec-validator>=0.5.0 pyparsing>=3.0.7 jsondiff>=1.1.2 - py-partiql-parser==0.5.4 + py-partiql-parser==0.5.5 aws-xray-sdk!=0.96,>=0.93 setuptools multipart @@ -69,7 +69,7 @@ proxy = openapi-spec-validator>=0.5.0 pyparsing>=3.0.7 jsondiff>=1.1.2 - py-partiql-parser==0.5.4 + py-partiql-parser==0.5.5 aws-xray-sdk!=0.96,>=0.93 setuptools multipart @@ -84,7 +84,7 @@ server = openapi-spec-validator>=0.5.0 pyparsing>=3.0.7 jsondiff>=1.1.2 - py-partiql-parser==0.5.4 + py-partiql-parser==0.5.5 aws-xray-sdk!=0.96,>=0.93 setuptools flask!=2.2.0,!=2.2.1 @@ -119,7 +119,7 @@ cloudformation = openapi-spec-validator>=0.5.0 pyparsing>=3.0.7 jsondiff>=1.1.2 - py-partiql-parser==0.5.4 + py-partiql-parser==0.5.5 aws-xray-sdk!=0.96,>=0.93 setuptools cloudfront = @@ -141,10 +141,10 @@ dms = ds = dynamodb = docker>=3.0.0 - py-partiql-parser==0.5.4 + py-partiql-parser==0.5.5 dynamodbstreams = docker>=3.0.0 - py-partiql-parser==0.5.4 + py-partiql-parser==0.5.5 ebs = ec2 = ec2instanceconnect = @@ -208,15 +208,15 @@ resourcegroupstaggingapi = openapi-spec-validator>=0.5.0 pyparsing>=3.0.7 jsondiff>=1.1.2 - py-partiql-parser==0.5.4 + py-partiql-parser==0.5.5 route53 = route53resolver = s3 = PyYAML>=5.1 - py-partiql-parser==0.5.4 + py-partiql-parser==0.5.5 s3crc32c = PyYAML>=5.1 - py-partiql-parser==0.5.4 + py-partiql-parser==0.5.5 crc32c s3control = sagemaker =