From 626803a78e028878bf2df8ca17372170b6958bd9 Mon Sep 17 00:00:00 2001 From: Bert Blommers Date: Sun, 18 Dec 2022 09:06:52 -0100 Subject: [PATCH] Prepare release 4.0.12 (#5781) --- CHANGELOG.md | 40 +++++++++ IMPLEMENTATION_COVERAGE.md | 118 +++++++++++++++++++++++---- docs/docs/services/athena.rst | 53 ++++++++++++ docs/docs/services/autoscaling.rst | 3 + docs/docs/services/ce.rst | 2 + docs/docs/services/cloudfront.rst | 1 + docs/docs/services/eks.rst | 1 + docs/docs/services/glue.rst | 16 ++++ docs/docs/services/kinesisvideo.rst | 2 + docs/docs/services/kms.rst | 9 ++ docs/docs/services/rds.rst | 2 +- docs/docs/services/sagemaker.rst | 34 ++++++++ docs/docs/services/stepfunctions.rst | 3 + moto/athena/models.py | 31 ++++++- tests/test_athena/test_athena.py | 28 ++++++- 15 files changed, 326 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e6d0df03..a4a2d41ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,46 @@ Moto Changelog ============== +4.0.12 +----- +Docker Digest for 4.0.12: + + General: + * Fixes our Kinesis-compatibility with botocore>=1.29.31 - earlier Moto-versions will connect to AWS when using this botocore-version + + New Methods: + * Athena: + * get_query_results() + * list_query_executions() + * RDS: + * promote_read_replica() + * Sagemaker: + * create_pipeline() + * delete_pipeline() + * list_pipelines() + + Miscellaneous: + * AWSLambda: publish_function() and update_function_code() now only increment the version if the source code has changed + * CognitoIDP: Passwords are now validated using the PasswordPolicy (either supplied, or the default) + * CloudFormation: create_stack() now propagates parameters StackPolicyBody and TimeoutInMinutes + * CloudFormation: create_stack_instances() now returns the actual OperationId + * CloudFormation: create_stack_set() now validates the provided name + * CloudFormation: create_stack_set() now supports the DeploymentTargets-parameter + * CloudFormation: create_stack_set() now actually creates the provided resources + * CloudFormation: create_stack_set() now propagates parameters AdministrationRoleARN and ExecutionRoleName + * CloudFormation: describe_stack_set() now returns the attributes Description, PermissionModel + * CloudFormation: delete_stack_set() now validates that no instances are present before deleting the set + * CloudWatch: get_metric_data() now supports the Label-parameter + * EC2: allocate_address() now has improved behaviour for the Domain-parameter + * EC2: create_volume() now supports the Iops-parameter + * ECR: Improved ImageManifest support + * KMS: describe_key() now returns an AccessDeniedException if the supplied policy does not allow this action + * Route53: change_resource_record_sets() has additional validations + * Route53: create_hosted_zone() now also creates a SOA-record by default + * S3: put_object() now returns the ChecksumAlgorithm-attribute if supplied + * SSM: describe_parameters() now has improved support for filtering by tags + + 4.0.11 ----- Docker Digest for 4.0.11: _sha256:ba07f61edd4f91b221ea20368586dce024e7da4d018e2741aceafa1f07f47ec5_ diff --git a/IMPLEMENTATION_COVERAGE.md b/IMPLEMENTATION_COVERAGE.md index 4244b4792..183c5bc7a 100644 --- a/IMPLEMENTATION_COVERAGE.md +++ b/IMPLEMENTATION_COVERAGE.md @@ -355,54 +355,78 @@ ## athena
-27% implemented +21% implemented - [ ] batch_get_named_query - [ ] batch_get_prepared_statement - [ ] batch_get_query_execution - [X] create_data_catalog - [X] create_named_query +- [ ] create_notebook - [ ] create_prepared_statement +- [ ] create_presigned_notebook_url - [X] create_work_group - [ ] delete_data_catalog - [ ] delete_named_query +- [ ] delete_notebook - [ ] delete_prepared_statement - [ ] delete_work_group +- [ ] export_notebook +- [ ] get_calculation_execution +- [ ] get_calculation_execution_code +- [ ] get_calculation_execution_status - [X] get_data_catalog - [ ] get_database - [X] get_named_query +- [ ] get_notebook_metadata - [ ] get_prepared_statement -- [ ] get_query_execution -- [ ] get_query_results +- [X] get_query_execution +- [X] get_query_results - [ ] get_query_runtime_statistics +- [ ] get_session +- [ ] get_session_status - [ ] get_table_metadata - [X] get_work_group +- [ ] import_notebook +- [ ] list_application_dpu_sizes +- [ ] list_calculation_executions - [X] list_data_catalogs - [ ] list_databases - [ ] list_engine_versions +- [ ] list_executors - [ ] list_named_queries +- [ ] list_notebook_metadata +- [ ] list_notebook_sessions - [ ] list_prepared_statements -- [ ] list_query_executions +- [X] list_query_executions +- [ ] list_sessions - [ ] list_table_metadata - [ ] list_tags_for_resource - [X] list_work_groups +- [ ] start_calculation_execution - [X] start_query_execution +- [ ] start_session +- [ ] stop_calculation_execution - [X] stop_query_execution - [ ] tag_resource +- [ ] terminate_session - [ ] untag_resource - [ ] update_data_catalog - [ ] update_named_query +- [ ] update_notebook +- [ ] update_notebook_metadata - [ ] update_prepared_statement - [ ] update_work_group
## autoscaling
-55% implemented +53% implemented - [X] attach_instances - [X] attach_load_balancer_target_groups - [X] attach_load_balancers +- [ ] attach_traffic_sources - [ ] batch_delete_scheduled_action - [ ] batch_put_scheduled_update_group_action - [ ] cancel_instance_refresh @@ -437,10 +461,12 @@ - [X] describe_scheduled_actions - [X] describe_tags - [ ] describe_termination_policy_types +- [ ] describe_traffic_sources - [ ] describe_warm_pool - [X] detach_instances - [X] detach_load_balancer_target_groups - [X] detach_load_balancers +- [ ] detach_traffic_sources - [ ] disable_metrics_collection - [X] enable_metrics_collection - [ ] enter_standby @@ -524,7 +550,7 @@ ## ce
-20% implemented +18% implemented - [ ] create_anomaly_monitor - [ ] create_anomaly_subscription @@ -553,8 +579,10 @@ - [ ] get_usage_forecast - [ ] list_cost_allocation_tags - [ ] list_cost_category_definitions +- [ ] list_savings_plans_purchase_recommendation_generation - [X] list_tags_for_resource - [ ] provide_anomaly_feedback +- [ ] start_savings_plans_purchase_recommendation_generation - [X] tag_resource - [X] untag_resource - [ ] update_anomaly_monitor @@ -734,6 +762,7 @@ - [ ] update_cloud_front_origin_access_identity - [ ] update_continuous_deployment_policy - [X] update_distribution +- [ ] update_distribution_with_staging_config - [ ] update_field_level_encryption_config - [ ] update_field_level_encryption_profile - [ ] update_function @@ -2439,7 +2468,7 @@ ## eks
-44% implemented +42% implemented - [ ] associate_encryption_config - [ ] associate_identity_provider_config @@ -2453,6 +2482,7 @@ - [X] delete_nodegroup - [ ] deregister_cluster - [ ] describe_addon +- [ ] describe_addon_configuration - [ ] describe_addon_versions - [X] describe_cluster - [X] describe_fargate_profile @@ -3049,7 +3079,7 @@ ## glue
-19% implemented +18% implemented - [X] batch_create_partition - [ ] batch_delete_connection @@ -3059,6 +3089,7 @@ - [ ] batch_get_blueprints - [ ] batch_get_crawlers - [ ] batch_get_custom_entity_types +- [ ] batch_get_data_quality_result - [ ] batch_get_dev_endpoints - [ ] batch_get_jobs - [X] batch_get_partition @@ -3066,6 +3097,8 @@ - [ ] batch_get_workflows - [ ] batch_stop_job_run - [X] batch_update_partition +- [ ] cancel_data_quality_rule_recommendation_run +- [ ] cancel_data_quality_ruleset_evaluation_run - [ ] cancel_ml_task_run - [ ] cancel_statement - [ ] check_schema_version_validity @@ -3074,6 +3107,7 @@ - [ ] create_connection - [X] create_crawler - [ ] create_custom_entity_type +- [ ] create_data_quality_ruleset - [X] create_database - [ ] create_dev_endpoint - [X] create_job @@ -3096,6 +3130,7 @@ - [ ] delete_connection - [X] delete_crawler - [ ] delete_custom_entity_type +- [ ] delete_data_quality_ruleset - [X] delete_database - [ ] delete_dev_endpoint - [ ] delete_job @@ -3128,6 +3163,10 @@ - [X] get_crawlers - [ ] get_custom_entity_type - [ ] get_data_catalog_encryption_settings +- [ ] get_data_quality_result +- [ ] get_data_quality_rule_recommendation_run +- [ ] get_data_quality_ruleset +- [ ] get_data_quality_ruleset_evaluation_run - [X] get_database - [X] get_databases - [ ] get_dataflow_graph @@ -3179,6 +3218,10 @@ - [X] list_crawlers - [ ] list_crawls - [ ] list_custom_entity_types +- [ ] list_data_quality_results +- [ ] list_data_quality_rule_recommendation_runs +- [ ] list_data_quality_ruleset_evaluation_runs +- [ ] list_data_quality_rulesets - [ ] list_dev_endpoints - [X] list_jobs - [ ] list_ml_transforms @@ -3203,6 +3246,8 @@ - [ ] start_blueprint_run - [X] start_crawler - [ ] start_crawler_schedule +- [ ] start_data_quality_rule_recommendation_run +- [ ] start_data_quality_ruleset_evaluation_run - [ ] start_export_labels_task_run - [ ] start_import_labels_task_run - [X] start_job_run @@ -3224,6 +3269,7 @@ - [ ] update_connection - [ ] update_crawler - [ ] update_crawler_schedule +- [ ] update_data_quality_ruleset - [X] update_database - [ ] update_dev_endpoint - [ ] update_job @@ -3878,12 +3924,13 @@ ## kinesisvideo
-21% implemented +20% implemented - [ ] create_signaling_channel - [X] create_stream - [ ] delete_signaling_channel - [X] delete_stream +- [ ] describe_edge_configuration - [ ] describe_image_generation_configuration - [ ] describe_notification_configuration - [ ] describe_signaling_channel @@ -3894,6 +3941,7 @@ - [X] list_streams - [ ] list_tags_for_resource - [ ] list_tags_for_stream +- [ ] start_edge_configuration_update - [ ] tag_resource - [ ] tag_stream - [ ] untag_resource @@ -4949,7 +4997,7 @@ - [ ] modify_event_subscription - [ ] modify_global_cluster - [X] modify_option_group -- [ ] promote_read_replica +- [X] promote_read_replica - [ ] promote_read_replica_db_cluster - [ ] purchase_reserved_db_instances_offering - [ ] reboot_db_cluster @@ -5571,14 +5619,18 @@ - [X] create_experiment - [ ] create_feature_group - [ ] create_flow_definition +- [ ] create_hub - [ ] create_human_task_ui - [ ] create_hyper_parameter_tuning_job - [ ] create_image - [ ] create_image_version +- [ ] create_inference_experiment - [ ] create_inference_recommendations_job - [ ] create_labeling_job - [X] create_model - [ ] create_model_bias_job_definition +- [ ] create_model_card +- [ ] create_model_card_export_job - [ ] create_model_explainability_job_definition - [ ] create_model_package - [ ] create_model_package_group @@ -5586,11 +5638,12 @@ - [ ] create_monitoring_schedule - [X] create_notebook_instance - [X] create_notebook_instance_lifecycle_config -- [ ] create_pipeline +- [X] create_pipeline - [ ] create_presigned_domain_url - [ ] create_presigned_notebook_instance_url - [X] create_processing_job - [ ] create_project +- [ ] create_space - [ ] create_studio_lifecycle_config - [X] create_training_job - [ ] create_transform_job @@ -5617,11 +5670,15 @@ - [X] delete_experiment - [ ] delete_feature_group - [ ] delete_flow_definition +- [ ] delete_hub +- [ ] delete_hub_content - [ ] delete_human_task_ui - [ ] delete_image - [ ] delete_image_version +- [ ] delete_inference_experiment - [X] delete_model - [ ] delete_model_bias_job_definition +- [ ] delete_model_card - [ ] delete_model_explainability_job_definition - [ ] delete_model_package - [ ] delete_model_package_group @@ -5630,8 +5687,9 @@ - [ ] delete_monitoring_schedule - [X] delete_notebook_instance - [X] delete_notebook_instance_lifecycle_config -- [ ] delete_pipeline +- [X] delete_pipeline - [ ] delete_project +- [ ] delete_space - [ ] delete_studio_lifecycle_config - [X] delete_tags - [X] delete_trial @@ -5661,15 +5719,20 @@ - [ ] describe_feature_group - [ ] describe_feature_metadata - [ ] describe_flow_definition +- [ ] describe_hub +- [ ] describe_hub_content - [ ] describe_human_task_ui - [ ] describe_hyper_parameter_tuning_job - [ ] describe_image - [ ] describe_image_version +- [ ] describe_inference_experiment - [ ] describe_inference_recommendations_job - [ ] describe_labeling_job - [ ] describe_lineage_group - [X] describe_model - [ ] describe_model_bias_job_definition +- [ ] describe_model_card +- [ ] describe_model_card_export_job - [ ] describe_model_explainability_job_definition - [ ] describe_model_package - [ ] describe_model_package_group @@ -5682,6 +5745,7 @@ - [ ] describe_pipeline_execution - [X] describe_processing_job - [ ] describe_project +- [ ] describe_space - [ ] describe_studio_lifecycle_config - [ ] describe_subscribed_workteam - [X] describe_training_job @@ -5699,6 +5763,7 @@ - [ ] get_model_package_group_policy - [ ] get_sagemaker_servicecatalog_portfolio_status - [ ] get_search_suggestions +- [ ] import_hub_content - [ ] list_actions - [ ] list_algorithms - [ ] list_app_image_configs @@ -5721,22 +5786,31 @@ - [X] list_experiments - [ ] list_feature_groups - [ ] list_flow_definitions +- [ ] list_hub_content_versions +- [ ] list_hub_contents +- [ ] list_hubs - [ ] list_human_task_uis - [ ] list_hyper_parameter_tuning_jobs - [ ] list_image_versions - [ ] list_images +- [ ] list_inference_experiments - [ ] list_inference_recommendations_job_steps - [ ] list_inference_recommendations_jobs - [ ] list_labeling_jobs - [ ] list_labeling_jobs_for_workteam - [ ] list_lineage_groups - [ ] list_model_bias_job_definitions +- [ ] list_model_card_export_jobs +- [ ] list_model_card_versions +- [ ] list_model_cards - [ ] list_model_explainability_job_definitions - [ ] list_model_metadata - [ ] list_model_package_groups - [ ] list_model_packages - [ ] list_model_quality_job_definitions - [X] list_models +- [ ] list_monitoring_alert_history +- [ ] list_monitoring_alerts - [ ] list_monitoring_executions - [ ] list_monitoring_schedules - [ ] list_notebook_instance_lifecycle_configs @@ -5744,9 +5818,10 @@ - [ ] list_pipeline_execution_steps - [ ] list_pipeline_executions - [ ] list_pipeline_parameters_for_execution -- [ ] list_pipelines +- [X] list_pipelines - [X] list_processing_jobs - [ ] list_projects +- [ ] list_spaces - [ ] list_stage_devices - [ ] list_studio_lifecycle_configs - [ ] list_subscribed_workteams @@ -5768,6 +5843,7 @@ - [ ] send_pipeline_execution_step_failure - [ ] send_pipeline_execution_step_success - [ ] start_edge_deployment_stage +- [ ] start_inference_experiment - [ ] start_monitoring_schedule - [X] start_notebook_instance - [ ] start_pipeline_execution @@ -5776,6 +5852,7 @@ - [ ] stop_edge_deployment_stage - [ ] stop_edge_packaging_job - [ ] stop_hyper_parameter_tuning_job +- [ ] stop_inference_experiment - [ ] stop_inference_recommendations_job - [ ] stop_labeling_job - [ ] stop_monitoring_schedule @@ -5797,14 +5874,19 @@ - [ ] update_experiment - [ ] update_feature_group - [ ] update_feature_metadata +- [ ] update_hub - [ ] update_image +- [ ] update_inference_experiment +- [ ] update_model_card - [ ] update_model_package +- [ ] update_monitoring_alert - [ ] update_monitoring_schedule - [ ] update_notebook_instance - [ ] update_notebook_instance_lifecycle_config - [ ] update_pipeline - [ ] update_pipeline_execution - [ ] update_project +- [ ] update_space - [ ] update_training_job - [ ] update_trial - [ ] update_trial_component @@ -6277,7 +6359,7 @@ ## stepfunctions
-56% implemented +50% implemented - [ ] create_activity - [X] create_state_machine @@ -6285,12 +6367,14 @@ - [X] delete_state_machine - [ ] describe_activity - [X] describe_execution +- [ ] describe_map_run - [X] describe_state_machine - [ ] describe_state_machine_for_execution - [ ] get_activity_task - [X] get_execution_history - [ ] list_activities - [X] list_executions +- [ ] list_map_runs - [X] list_state_machines - [X] list_tags_for_resource - [ ] send_task_failure @@ -6301,6 +6385,7 @@ - [X] stop_execution - [X] tag_resource - [X] untag_resource +- [ ] update_map_run - [X] update_state_machine
@@ -6561,6 +6646,7 @@ - cloudsearch - cloudsearchdomain - codeartifact +- codecatalyst - codedeploy - codeguru-reviewer - codeguruprofiler @@ -6586,6 +6672,7 @@ - discovery - dlm - docdb +- docdb-elastic - drs - ecr-public - elastic-inference @@ -6685,6 +6772,7 @@ - pinpoint-email - pinpoint-sms-voice - pinpoint-sms-voice-v2 +- pipes - pricing - privatenetworks - proton @@ -6706,6 +6794,8 @@ - sagemaker-a2i-runtime - sagemaker-edge - sagemaker-featurestore-runtime +- sagemaker-geospatial +- sagemaker-metrics - sagemaker-runtime - savingsplans - scheduler diff --git a/docs/docs/services/athena.rst b/docs/docs/services/athena.rst index 259728923..7e99f7980 100644 --- a/docs/docs/services/athena.rst +++ b/docs/docs/services/athena.rst @@ -30,36 +30,89 @@ athena - [ ] batch_get_query_execution - [X] create_data_catalog - [X] create_named_query +- [ ] create_notebook - [ ] create_prepared_statement +- [ ] create_presigned_notebook_url - [X] create_work_group - [ ] delete_data_catalog - [ ] delete_named_query +- [ ] delete_notebook - [ ] delete_prepared_statement - [ ] delete_work_group +- [ ] export_notebook +- [ ] get_calculation_execution +- [ ] get_calculation_execution_code +- [ ] get_calculation_execution_status - [X] get_data_catalog - [ ] get_database - [X] get_named_query +- [ ] get_notebook_metadata - [ ] get_prepared_statement - [X] get_query_execution - [X] get_query_results + + Queries are not executed, so this call will always return 0 rows by default. + + When using decorators, you can use the internal API to manually set results: + + .. sourcecode:: python + + from moto.athena.models import athena_backends, QueryResults + from moto.core import DEFAULT_ACCOUNT_ID + + backend = athena_backends[DEFAULT_ACCOUNT_ID]["us-east-1"] + rows = [{'Data': [{'VarCharValue': '..'}]}] + column_info = [{ + 'CatalogName': 'string', + 'SchemaName': 'string', + 'TableName': 'string', + 'Name': 'string', + 'Label': 'string', + 'Type': 'string', + 'Precision': 123, + 'Scale': 123, + 'Nullable': 'NOT_NULL', + 'CaseSensitive': True + }] + results = QueryResults(rows=rows, column_info=column_info) + backend.query_results["test"] = results + + result = client.get_query_results(QueryExecutionId="test") + + - [ ] get_query_runtime_statistics +- [ ] get_session +- [ ] get_session_status - [ ] get_table_metadata - [X] get_work_group +- [ ] import_notebook +- [ ] list_application_dpu_sizes +- [ ] list_calculation_executions - [X] list_data_catalogs - [ ] list_databases - [ ] list_engine_versions +- [ ] list_executors - [ ] list_named_queries +- [ ] list_notebook_metadata +- [ ] list_notebook_sessions - [ ] list_prepared_statements - [X] list_query_executions +- [ ] list_sessions - [ ] list_table_metadata - [ ] list_tags_for_resource - [X] list_work_groups +- [ ] start_calculation_execution - [X] start_query_execution +- [ ] start_session +- [ ] stop_calculation_execution - [X] stop_query_execution - [ ] tag_resource +- [ ] terminate_session - [ ] untag_resource - [ ] update_data_catalog - [ ] update_named_query +- [ ] update_notebook +- [ ] update_notebook_metadata - [ ] update_prepared_statement - [ ] update_work_group diff --git a/docs/docs/services/autoscaling.rst b/docs/docs/services/autoscaling.rst index 032b6743a..3f79be2b3 100644 --- a/docs/docs/services/autoscaling.rst +++ b/docs/docs/services/autoscaling.rst @@ -28,6 +28,7 @@ autoscaling - [X] attach_instances - [X] attach_load_balancer_target_groups - [X] attach_load_balancers +- [ ] attach_traffic_sources - [ ] batch_delete_scheduled_action - [ ] batch_put_scheduled_update_group_action - [ ] cancel_instance_refresh @@ -67,10 +68,12 @@ autoscaling - [ ] describe_termination_policy_types +- [ ] describe_traffic_sources - [ ] describe_warm_pool - [X] detach_instances - [X] detach_load_balancer_target_groups - [X] detach_load_balancers +- [ ] detach_traffic_sources - [ ] disable_metrics_collection - [X] enable_metrics_collection - [ ] enter_standby diff --git a/docs/docs/services/ce.rst b/docs/docs/services/ce.rst index b8659be13..6663f3da7 100644 --- a/docs/docs/services/ce.rst +++ b/docs/docs/services/ce.rst @@ -66,8 +66,10 @@ ce - [ ] get_usage_forecast - [ ] list_cost_allocation_tags - [ ] list_cost_category_definitions +- [ ] list_savings_plans_purchase_recommendation_generation - [X] list_tags_for_resource - [ ] provide_anomaly_feedback +- [ ] start_savings_plans_purchase_recommendation_generation - [X] tag_resource - [X] untag_resource - [ ] update_anomaly_monitor diff --git a/docs/docs/services/cloudfront.rst b/docs/docs/services/cloudfront.rst index e4a9e5aea..655a26573 100644 --- a/docs/docs/services/cloudfront.rst +++ b/docs/docs/services/cloudfront.rst @@ -144,6 +144,7 @@ cloudfront Calling this function without a value is invalid, per AWS' behaviour +- [ ] update_distribution_with_staging_config - [ ] update_field_level_encryption_config - [ ] update_field_level_encryption_profile - [ ] update_function diff --git a/docs/docs/services/eks.rst b/docs/docs/services/eks.rst index 1a4a99320..47798868a 100644 --- a/docs/docs/services/eks.rst +++ b/docs/docs/services/eks.rst @@ -37,6 +37,7 @@ eks - [X] delete_nodegroup - [ ] deregister_cluster - [ ] describe_addon +- [ ] describe_addon_configuration - [ ] describe_addon_versions - [X] describe_cluster - [X] describe_fargate_profile diff --git a/docs/docs/services/glue.rst b/docs/docs/services/glue.rst index 1319e84db..a160d61c8 100644 --- a/docs/docs/services/glue.rst +++ b/docs/docs/services/glue.rst @@ -33,6 +33,7 @@ glue - [ ] batch_get_blueprints - [ ] batch_get_crawlers - [ ] batch_get_custom_entity_types +- [ ] batch_get_data_quality_result - [ ] batch_get_dev_endpoints - [ ] batch_get_jobs - [X] batch_get_partition @@ -40,6 +41,8 @@ glue - [ ] batch_get_workflows - [ ] batch_stop_job_run - [X] batch_update_partition +- [ ] cancel_data_quality_rule_recommendation_run +- [ ] cancel_data_quality_ruleset_evaluation_run - [ ] cancel_ml_task_run - [ ] cancel_statement - [ ] check_schema_version_validity @@ -48,6 +51,7 @@ glue - [ ] create_connection - [X] create_crawler - [ ] create_custom_entity_type +- [ ] create_data_quality_ruleset - [X] create_database - [ ] create_dev_endpoint - [X] create_job @@ -74,6 +78,7 @@ glue - [ ] delete_connection - [X] delete_crawler - [ ] delete_custom_entity_type +- [ ] delete_data_quality_ruleset - [X] delete_database - [ ] delete_dev_endpoint - [ ] delete_job @@ -106,6 +111,10 @@ glue - [X] get_crawlers - [ ] get_custom_entity_type - [ ] get_data_catalog_encryption_settings +- [ ] get_data_quality_result +- [ ] get_data_quality_rule_recommendation_run +- [ ] get_data_quality_ruleset +- [ ] get_data_quality_ruleset_evaluation_run - [X] get_database - [X] get_databases - [ ] get_dataflow_graph @@ -170,6 +179,10 @@ glue - [X] list_crawlers - [ ] list_crawls - [ ] list_custom_entity_types +- [ ] list_data_quality_results +- [ ] list_data_quality_rule_recommendation_runs +- [ ] list_data_quality_ruleset_evaluation_runs +- [ ] list_data_quality_rulesets - [ ] list_dev_endpoints - [X] list_jobs - [ ] list_ml_transforms @@ -194,6 +207,8 @@ glue - [ ] start_blueprint_run - [X] start_crawler - [ ] start_crawler_schedule +- [ ] start_data_quality_rule_recommendation_run +- [ ] start_data_quality_ruleset_evaluation_run - [ ] start_export_labels_task_run - [ ] start_import_labels_task_run - [X] start_job_run @@ -215,6 +230,7 @@ glue - [ ] update_connection - [ ] update_crawler - [ ] update_crawler_schedule +- [ ] update_data_quality_ruleset - [X] update_database - [ ] update_dev_endpoint - [ ] update_job diff --git a/docs/docs/services/kinesisvideo.rst b/docs/docs/services/kinesisvideo.rst index 1c2e22a3f..80ef74ba1 100644 --- a/docs/docs/services/kinesisvideo.rst +++ b/docs/docs/services/kinesisvideo.rst @@ -33,6 +33,7 @@ kinesisvideo The CurrentVersion-parameter is not yet implemented +- [ ] describe_edge_configuration - [ ] describe_image_generation_configuration - [ ] describe_notification_configuration - [ ] describe_signaling_channel @@ -47,6 +48,7 @@ kinesisvideo - [ ] list_tags_for_resource - [ ] list_tags_for_stream +- [ ] start_edge_configuration_update - [ ] tag_resource - [ ] tag_stream - [ ] untag_resource diff --git a/docs/docs/services/kms.rst b/docs/docs/services/kms.rst index 0667f3082..cc03faed7 100644 --- a/docs/docs/services/kms.rst +++ b/docs/docs/services/kms.rst @@ -31,6 +31,15 @@ kms - [ ] create_custom_key_store - [X] create_grant - [X] create_key + + The provided Policy currently does not need to be valid. If it is valid, Moto will perform authorization checks on key-related operations, just like AWS does. + + These authorization checks are quite basic for now. Moto will only throw an AccessDeniedException if the following conditions are met: + - The principal is set to "*" + - The resource is set to "*" + - The Action matches `describe_key` + + - [X] decrypt - [X] delete_alias Delete the alias. diff --git a/docs/docs/services/rds.rst b/docs/docs/services/rds.rst index f76a62b84..a4f2888bf 100644 --- a/docs/docs/services/rds.rst +++ b/docs/docs/services/rds.rst @@ -135,7 +135,7 @@ rds - [ ] modify_event_subscription - [ ] modify_global_cluster - [X] modify_option_group -- [ ] promote_read_replica +- [X] promote_read_replica - [ ] promote_read_replica_db_cluster - [ ] purchase_reserved_db_instances_offering - [ ] reboot_db_cluster diff --git a/docs/docs/services/sagemaker.rst b/docs/docs/services/sagemaker.rst index 0d75c38e6..7156caf3d 100644 --- a/docs/docs/services/sagemaker.rst +++ b/docs/docs/services/sagemaker.rst @@ -49,14 +49,18 @@ sagemaker - [X] create_experiment - [ ] create_feature_group - [ ] create_flow_definition +- [ ] create_hub - [ ] create_human_task_ui - [ ] create_hyper_parameter_tuning_job - [ ] create_image - [ ] create_image_version +- [ ] create_inference_experiment - [ ] create_inference_recommendations_job - [ ] create_labeling_job - [X] create_model - [ ] create_model_bias_job_definition +- [ ] create_model_card +- [ ] create_model_card_export_job - [ ] create_model_explainability_job_definition - [ ] create_model_package - [ ] create_model_package_group @@ -69,6 +73,7 @@ sagemaker - [ ] create_presigned_notebook_instance_url - [X] create_processing_job - [ ] create_project +- [ ] create_space - [ ] create_studio_lifecycle_config - [X] create_training_job - [ ] create_transform_job @@ -95,11 +100,15 @@ sagemaker - [X] delete_experiment - [ ] delete_feature_group - [ ] delete_flow_definition +- [ ] delete_hub +- [ ] delete_hub_content - [ ] delete_human_task_ui - [ ] delete_image - [ ] delete_image_version +- [ ] delete_inference_experiment - [X] delete_model - [ ] delete_model_bias_job_definition +- [ ] delete_model_card - [ ] delete_model_explainability_job_definition - [ ] delete_model_package - [ ] delete_model_package_group @@ -110,6 +119,7 @@ sagemaker - [X] delete_notebook_instance_lifecycle_config - [X] delete_pipeline - [ ] delete_project +- [ ] delete_space - [ ] delete_studio_lifecycle_config - [X] delete_tags - [X] delete_trial @@ -139,15 +149,20 @@ sagemaker - [ ] describe_feature_group - [ ] describe_feature_metadata - [ ] describe_flow_definition +- [ ] describe_hub +- [ ] describe_hub_content - [ ] describe_human_task_ui - [ ] describe_hyper_parameter_tuning_job - [ ] describe_image - [ ] describe_image_version +- [ ] describe_inference_experiment - [ ] describe_inference_recommendations_job - [ ] describe_labeling_job - [ ] describe_lineage_group - [X] describe_model - [ ] describe_model_bias_job_definition +- [ ] describe_model_card +- [ ] describe_model_card_export_job - [ ] describe_model_explainability_job_definition - [ ] describe_model_package - [ ] describe_model_package_group @@ -160,6 +175,7 @@ sagemaker - [ ] describe_pipeline_execution - [X] describe_processing_job - [ ] describe_project +- [ ] describe_space - [ ] describe_studio_lifecycle_config - [ ] describe_subscribed_workteam - [X] describe_training_job @@ -177,6 +193,7 @@ sagemaker - [ ] get_model_package_group_policy - [ ] get_sagemaker_servicecatalog_portfolio_status - [ ] get_search_suggestions +- [ ] import_hub_content - [ ] list_actions - [ ] list_algorithms - [ ] list_app_image_configs @@ -199,22 +216,31 @@ sagemaker - [X] list_experiments - [ ] list_feature_groups - [ ] list_flow_definitions +- [ ] list_hub_content_versions +- [ ] list_hub_contents +- [ ] list_hubs - [ ] list_human_task_uis - [ ] list_hyper_parameter_tuning_jobs - [ ] list_image_versions - [ ] list_images +- [ ] list_inference_experiments - [ ] list_inference_recommendations_job_steps - [ ] list_inference_recommendations_jobs - [ ] list_labeling_jobs - [ ] list_labeling_jobs_for_workteam - [ ] list_lineage_groups - [ ] list_model_bias_job_definitions +- [ ] list_model_card_export_jobs +- [ ] list_model_card_versions +- [ ] list_model_cards - [ ] list_model_explainability_job_definitions - [ ] list_model_metadata - [ ] list_model_package_groups - [ ] list_model_packages - [ ] list_model_quality_job_definitions - [X] list_models +- [ ] list_monitoring_alert_history +- [ ] list_monitoring_alerts - [ ] list_monitoring_executions - [ ] list_monitoring_schedules - [ ] list_notebook_instance_lifecycle_configs @@ -225,6 +251,7 @@ sagemaker - [X] list_pipelines - [X] list_processing_jobs - [ ] list_projects +- [ ] list_spaces - [ ] list_stage_devices - [ ] list_studio_lifecycle_configs - [ ] list_subscribed_workteams @@ -246,6 +273,7 @@ sagemaker - [ ] send_pipeline_execution_step_failure - [ ] send_pipeline_execution_step_success - [ ] start_edge_deployment_stage +- [ ] start_inference_experiment - [ ] start_monitoring_schedule - [X] start_notebook_instance - [ ] start_pipeline_execution @@ -254,6 +282,7 @@ sagemaker - [ ] stop_edge_deployment_stage - [ ] stop_edge_packaging_job - [ ] stop_hyper_parameter_tuning_job +- [ ] stop_inference_experiment - [ ] stop_inference_recommendations_job - [ ] stop_labeling_job - [ ] stop_monitoring_schedule @@ -275,14 +304,19 @@ sagemaker - [ ] update_experiment - [ ] update_feature_group - [ ] update_feature_metadata +- [ ] update_hub - [ ] update_image +- [ ] update_inference_experiment +- [ ] update_model_card - [ ] update_model_package +- [ ] update_monitoring_alert - [ ] update_monitoring_schedule - [ ] update_notebook_instance - [ ] update_notebook_instance_lifecycle_config - [ ] update_pipeline - [ ] update_pipeline_execution - [ ] update_project +- [ ] update_space - [ ] update_training_job - [ ] update_trial - [ ] update_trial_component diff --git a/docs/docs/services/stepfunctions.rst b/docs/docs/services/stepfunctions.rst index c55b65d90..cdabcc009 100644 --- a/docs/docs/services/stepfunctions.rst +++ b/docs/docs/services/stepfunctions.rst @@ -31,12 +31,14 @@ stepfunctions - [X] delete_state_machine - [ ] describe_activity - [X] describe_execution +- [ ] describe_map_run - [X] describe_state_machine - [ ] describe_state_machine_for_execution - [ ] get_activity_task - [X] get_execution_history - [ ] list_activities - [X] list_executions +- [ ] list_map_runs - [X] list_state_machines - [X] list_tags_for_resource - [ ] send_task_failure @@ -47,5 +49,6 @@ stepfunctions - [X] stop_execution - [X] tag_resource - [X] untag_resource +- [ ] update_map_run - [X] update_state_machine diff --git a/moto/athena/models.py b/moto/athena/models.py index b8fccbeec..bfd2d9205 100644 --- a/moto/athena/models.py +++ b/moto/athena/models.py @@ -94,7 +94,7 @@ class Execution(BaseModel): class QueryResults(BaseModel): - def __init__(self, rows: List[Dict[str, Any]], column_info: List[str]): + def __init__(self, rows: List[Dict[str, Any]], column_info: List[Dict[str, str]]): self.rows = rows self.column_info = column_info @@ -194,6 +194,35 @@ class AthenaBackend(BaseBackend): return self.executions def get_query_results(self, exec_id: str) -> QueryResults: + """ + Queries are not executed, so this call will always return 0 rows by default. + + When using decorators, you can use the internal API to manually set results: + + .. sourcecode:: python + + from moto.athena.models import athena_backends, QueryResults + from moto.core import DEFAULT_ACCOUNT_ID + + backend = athena_backends[DEFAULT_ACCOUNT_ID]["us-east-1"] + rows = [{'Data': [{'VarCharValue': '..'}]}] + column_info = [{ + 'CatalogName': 'string', + 'SchemaName': 'string', + 'TableName': 'string', + 'Name': 'string', + 'Label': 'string', + 'Type': 'string', + 'Precision': 123, + 'Scale': 123, + 'Nullable': 'NOT_NULL', + 'CaseSensitive': True + }] + results = QueryResults(rows=rows, column_info=column_info) + backend.query_results["test"] = results + + result = client.get_query_results(QueryExecutionId="test") + """ results = ( self.query_results[exec_id] if exec_id in self.query_results diff --git a/tests/test_athena/test_athena.py b/tests/test_athena/test_athena.py index fd9c5be62..24ce64c96 100644 --- a/tests/test_athena/test_athena.py +++ b/tests/test_athena/test_athena.py @@ -3,7 +3,9 @@ import pytest import boto3 import sure # noqa # pylint: disable=unused-import -from moto import mock_athena +from moto import mock_athena, settings +from moto.athena.models import athena_backends, QueryResults +from moto.core import DEFAULT_ACCOUNT_ID @mock_athena @@ -284,6 +286,30 @@ def test_get_query_results(): result["ResultSet"]["Rows"].should.equal([]) result["ResultSet"]["ResultSetMetadata"]["ColumnInfo"].should.equal([]) + if not settings.TEST_SERVER_MODE: + backend = athena_backends[DEFAULT_ACCOUNT_ID]["us-east-1"] + rows = [{"Data": [{"VarCharValue": ".."}]}] + column_info = [ + { + "CatalogName": "string", + "SchemaName": "string", + "TableName": "string", + "Name": "string", + "Label": "string", + "Type": "string", + "Precision": 123, + "Scale": 123, + "Nullable": "NOT_NULL", + "CaseSensitive": True, + } + ] + results = QueryResults(rows=rows, column_info=column_info) + backend.query_results["test"] = results + + result = client.get_query_results(QueryExecutionId="test") + result["ResultSet"]["Rows"].should.equal(rows) + result["ResultSet"]["ResultSetMetadata"]["ColumnInfo"].should.equal(column_info) + @mock_athena def test_list_query_executions():