Skip to content

Commit

Permalink
Prepare release 4.2.6 (#6916)
Browse files Browse the repository at this point in the history
  • Loading branch information
bblommers authored Oct 15, 2023
1 parent 9ed886d commit f52223c
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 26 deletions.
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,43 @@
Moto Changelog
==============

4.2.6
-----
Docker Digest for 4.2.6: <autopopulateddigest>

New Services:
* IVS:
* batch_get_channel()
* create_channel()
* delete_channel()
* get_channel()
* list_channels()
* update_channel()

New Methods:
* LakeFormation:
* add_lf_tags_to_resource()
* get_resource_lf_tags()
* remove_lf_tags_from_resource()
* update_lf_tag()

* Sagemaker:
* describe_model_package_group()
* update_model_package()

Miscellaneous:
* Batch: submit_job() now behaves correctly when passing the arrayProperties-parameter
* DynamoDB: Improved PartiQL parser, with support for different types (Decimals/Booleans) and queries with quoted table-names
* EC2: TagSpecifications now throw an error if the ResourceType is not provided
* EC2: run_instances()/describe_instances() now always return the same attributes (before, both operations were missing different fields)
* EC2: associate_dhcp_options() now supports DhcpOptionsId=default
* EC2: create_key_pair() now supports the KeyType-parameter
* EC2: run_instances() now returns the Placement.HostId attribute
* ELBv2: modify_target_group_attributes() now has additional validations
* Events: put_events() now throws a warning when Detail field is not a dict
* IOT: update_thing() now behaves correctly with empty attributes
* S3: head_object() now raises a MethodNotAllowed for DeleteMarkers

4.2.5
-----
Docker Digest for 4.2.5: _sha256:076cecca9b8ba35b545d23eb5bf780902fbf23eb3610f332eef7adea1f4d2ef7_
Expand Down
17 changes: 16 additions & 1 deletion IMPLEMENTATION_COVERAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2272,6 +2272,7 @@
- [X] disable_ebs_encryption_by_default
- [ ] disable_fast_launch
- [ ] disable_fast_snapshot_restores
- [ ] disable_image
- [ ] disable_image_block_public_access
- [ ] disable_image_deprecation
- [ ] disable_ipam_organization_admin_account
Expand Down Expand Up @@ -2299,6 +2300,7 @@
- [X] enable_ebs_encryption_by_default
- [ ] enable_fast_launch
- [ ] enable_fast_snapshot_restores
- [ ] enable_image
- [ ] enable_image_block_public_access
- [ ] enable_image_deprecation
- [ ] enable_ipam_organization_admin_account
Expand Down Expand Up @@ -7258,21 +7260,33 @@

## textract
<details>
<summary>15% implemented</summary>
<summary>8% implemented</summary>

- [ ] analyze_document
- [ ] analyze_expense
- [ ] analyze_id
- [ ] create_adapter
- [ ] create_adapter_version
- [ ] delete_adapter
- [ ] delete_adapter_version
- [ ] detect_document_text
- [ ] get_adapter
- [ ] get_adapter_version
- [ ] get_document_analysis
- [X] get_document_text_detection
- [ ] get_expense_analysis
- [ ] get_lending_analysis
- [ ] get_lending_analysis_summary
- [ ] list_adapter_versions
- [ ] list_adapters
- [ ] list_tags_for_resource
- [ ] start_document_analysis
- [X] start_document_text_detection
- [ ] start_expense_analysis
- [ ] start_lending_analysis
- [ ] tag_resource
- [ ] untag_resource
- [ ] update_adapter
</details>

## timestream-write
Expand Down Expand Up @@ -7468,6 +7482,7 @@
- cur
- customer-profiles
- dataexchange
- datazone
- detective
- devicefarm
- devops-guru
Expand Down
2 changes: 2 additions & 0 deletions docs/docs/services/ec2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ ec2
- [X] disable_ebs_encryption_by_default
- [ ] disable_fast_launch
- [ ] disable_fast_snapshot_restores
- [ ] disable_image
- [ ] disable_image_block_public_access
- [ ] disable_image_deprecation
- [ ] disable_ipam_organization_admin_account
Expand Down Expand Up @@ -458,6 +459,7 @@ ec2
- [X] enable_ebs_encryption_by_default
- [ ] enable_fast_launch
- [ ] enable_fast_snapshot_restores
- [ ] enable_image
- [ ] enable_image_block_public_access
- [ ] enable_image_deprecation
- [ ] enable_ipam_organization_admin_account
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/services/sagemaker.rst
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ sagemaker
- [ ] describe_model_card_export_job
- [ ] describe_model_explainability_job_definition
- [X] describe_model_package
- [ ] describe_model_package_group
- [X] describe_model_package_group
- [ ] describe_model_quality_job_definition
- [ ] describe_monitoring_schedule
- [ ] describe_notebook_instance
Expand Down Expand Up @@ -319,7 +319,7 @@ sagemaker
- [ ] update_image_version
- [ ] update_inference_experiment
- [ ] update_model_card
- [ ] update_model_package
- [X] update_model_package
- [ ] update_monitoring_alert
- [ ] update_monitoring_schedule
- [ ] update_notebook_instance
Expand Down
12 changes: 12 additions & 0 deletions docs/docs/services/textract.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ textract
- [ ] analyze_document
- [ ] analyze_expense
- [ ] analyze_id
- [ ] create_adapter
- [ ] create_adapter_version
- [ ] delete_adapter
- [ ] delete_adapter_version
- [ ] detect_document_text
- [ ] get_adapter
- [ ] get_adapter_version
- [ ] get_document_analysis
- [X] get_document_text_detection

Expand All @@ -40,6 +46,9 @@ textract
- [ ] get_expense_analysis
- [ ] get_lending_analysis
- [ ] get_lending_analysis_summary
- [ ] list_adapter_versions
- [ ] list_adapters
- [ ] list_tags_for_resource
- [ ] start_document_analysis
- [X] start_document_text_detection

Expand All @@ -48,4 +57,7 @@ textract

- [ ] start_expense_analysis
- [ ] start_lending_analysis
- [ ] tag_resource
- [ ] untag_resource
- [ ] update_adapter

17 changes: 4 additions & 13 deletions moto/dynamodb/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import copy
import json
import re

from collections import OrderedDict
Expand All @@ -26,7 +25,6 @@
TransactWriteSingleOpException,
)
from moto.dynamodb.models.dynamo_type import DynamoType, Item
from moto.dynamodb.models.dynamo_type import serializer, deserializer
from moto.dynamodb.models.table import (
Table,
RestoredTable,
Expand Down Expand Up @@ -787,18 +785,11 @@ def execute_statement(
# Just pass all tables to PartiQL
source_data: Dict[str, str] = dict()
for table in self.tables.values():
source_data[table.name] = "\n".join(
[json.dumps(item.to_regular_json()) for item in table.all_items()]
)

# Parameters are in DynamoDB JSON form ({"S": "value"}) - we only want the value itself
parameters = [deserializer.deserialize(param) for param in parameters]
source_data[table.name] = [ # type: ignore
item.to_json()["Attributes"] for item in table.all_items()
]

regular_json = partiql.query(statement, source_data, parameters)
return [
{key: serializer.serialize(value) for key, value in item.items()}
for item in regular_json
]
return partiql.query(statement, source_data, parameters)

def execute_transaction(
self, statements: List[Dict[str, Any]]
Expand Down
18 changes: 9 additions & 9 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ all =
openapi-spec-validator>=0.2.8
pyparsing>=3.0.7
jsondiff>=1.1.2
py-partiql-parser==0.3.8
py-partiql-parser==0.4.0
aws-xray-sdk!=0.96,>=0.93
setuptools
multipart
Expand All @@ -67,7 +67,7 @@ proxy =
openapi-spec-validator>=0.2.8
pyparsing>=3.0.7
jsondiff>=1.1.2
py-partiql-parser==0.3.8
py-partiql-parser==0.4.0
aws-xray-sdk!=0.96,>=0.93
setuptools
multipart
Expand All @@ -82,7 +82,7 @@ server =
openapi-spec-validator>=0.2.8
pyparsing>=3.0.7
jsondiff>=1.1.2
py-partiql-parser==0.3.8
py-partiql-parser==0.4.0
aws-xray-sdk!=0.96,>=0.93
setuptools
flask!=2.2.0,!=2.2.1
Expand Down Expand Up @@ -116,7 +116,7 @@ cloudformation =
openapi-spec-validator>=0.2.8
pyparsing>=3.0.7
jsondiff>=1.1.2
py-partiql-parser==0.3.8
py-partiql-parser==0.4.0
aws-xray-sdk!=0.96,>=0.93
setuptools
cloudfront =
Expand All @@ -139,10 +139,10 @@ dms =
ds = sshpubkeys>=3.1.0
dynamodb =
docker>=3.0.0
py-partiql-parser==0.3.8
py-partiql-parser==0.4.0
dynamodbstreams =
docker>=3.0.0
py-partiql-parser==0.3.8
py-partiql-parser==0.4.0
ebs = sshpubkeys>=3.1.0
ec2 = sshpubkeys>=3.1.0
ec2instanceconnect =
Expand Down Expand Up @@ -205,15 +205,15 @@ resourcegroupstaggingapi =
openapi-spec-validator>=0.2.8
pyparsing>=3.0.7
jsondiff>=1.1.2
py-partiql-parser==0.3.8
py-partiql-parser==0.4.0
route53 =
route53resolver = sshpubkeys>=3.1.0
s3 =
PyYAML>=5.1
py-partiql-parser==0.3.8
py-partiql-parser==0.4.0
s3crc32c =
PyYAML>=5.1
py-partiql-parser==0.3.8
py-partiql-parser==0.4.0
crc32c
s3control =
sagemaker =
Expand Down
13 changes: 12 additions & 1 deletion tests/test_dynamodb/test_dynamodb_statements.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"pk": {"S": "msg1"},
"body": {"S": "some text"},
"nested_attrs": {"M": {"some": {"S": "key"}}},
"price": {"N": "123.4"},
"list_attrs": {"L": [{"BOOL": True}, {"BOOL": False}]},
"bool_attr": {"BOOL": True},
}
Expand All @@ -35,7 +36,7 @@ def test_execute_statement_select_star(table_name=None):

@pytest.mark.aws_verified
@dynamodb_aws_verified
def test_execute_statement_select_unique(table_name=None):
def test_execute_statement_select_attr(table_name=None):
client = boto3.client("dynamodb", "us-east-1")
create_items(table_name)
items = client.execute_statement(Statement=f"select unique_key from {table_name}")[
Expand All @@ -45,6 +46,16 @@ def test_execute_statement_select_unique(table_name=None):
assert {"unique_key": {"S": "key"}} in items


@pytest.mark.aws_verified
@dynamodb_aws_verified
def test_execute_statement_with_quoted_table(table_name=None):
client = boto3.client("dynamodb", "us-east-1")
create_items(table_name)
items = client.execute_statement(Statement=f'select * from "{table_name}"')["Items"]
assert item1 in items
assert item2 in items


@pytest.mark.aws_verified
@dynamodb_aws_verified
def test_execute_statement_with_parameter(table_name=None):
Expand Down

0 comments on commit f52223c

Please sign in to comment.