localstack-core 4.7.1.dev40__py3-none-any.whl → 4.7.1.dev42__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of localstack-core might be problematic. Click here for more details.
- localstack/aws/handlers/service.py +2 -2
- localstack/aws/mocking.py +1 -1
- localstack/aws/protocol/serializer.py +1 -1
- localstack/config.py +1 -1
- localstack/dev/run/__main__.py +1 -1
- localstack/services/cloudformation/engine/entities.py +1 -1
- localstack/services/cloudformation/engine/parameters.py +1 -1
- localstack/services/cloudformation/engine/v2/change_set_model.py +16 -16
- localstack/services/cloudformation/engine/v2/change_set_model_describer.py +1 -1
- localstack/services/cloudformation/engine/v2/change_set_model_executor.py +3 -3
- localstack/services/cloudformation/engine/v2/change_set_model_preproc.py +16 -16
- localstack/services/cloudformation/engine/v2/change_set_model_transform.py +3 -3
- localstack/services/cloudformation/engine/v2/change_set_model_validator.py +1 -1
- localstack/services/cloudformation/provider_utils.py +31 -1
- localstack/services/cloudformation/scaffolding/__main__.py +5 -5
- localstack/services/cloudformation/stores.py +1 -1
- localstack/services/cloudformation/v2/provider.py +3 -3
- localstack/services/lambda_/api_utils.py +1 -1
- localstack/services/lambda_/invocation/docker_runtime_executor.py +1 -1
- localstack/services/lambda_/provider.py +1 -1
- localstack/services/secretsmanager/provider.py +1 -1
- localstack/services/sqs/provider.py +1 -1
- localstack/services/stepfunctions/asl/component/common/assign/assign_decl.py +1 -1
- localstack/services/stepfunctions/asl/component/common/assign/assign_decl_binding.py +1 -1
- localstack/services/stepfunctions/asl/component/common/assign/assign_template_value_array.py +1 -1
- localstack/services/stepfunctions/asl/component/common/assign/assign_template_value_object.py +1 -1
- localstack/services/stepfunctions/asl/component/common/error_name/states_error_name_type.py +1 -1
- localstack/services/stepfunctions/asl/component/common/jsonata/jsonata_template_value_array.py +1 -1
- localstack/services/stepfunctions/asl/component/common/jsonata/jsonata_template_value_object.py +1 -1
- localstack/services/stepfunctions/asl/component/common/path/input_path.py +1 -1
- localstack/services/stepfunctions/asl/component/common/path/output_path.py +1 -1
- localstack/services/stepfunctions/asl/component/common/payload/payloadvalue/payloadarr/payload_arr.py +1 -1
- localstack/services/stepfunctions/asl/component/common/payload/payloadvalue/payloadtmpl/payload_tmpl.py +1 -1
- localstack/services/stepfunctions/asl/component/common/string/string_expression.py +1 -1
- localstack/services/stepfunctions/asl/component/intrinsic/argument/argument.py +1 -1
- localstack/services/stepfunctions/asl/component/intrinsic/function/statesfunction/array/array_partition.py +1 -1
- localstack/services/stepfunctions/asl/component/intrinsic/function/statesfunction/generic/string_format.py +1 -1
- localstack/services/stepfunctions/asl/component/intrinsic/function/statesfunction/states_function_array.py +1 -1
- localstack/services/stepfunctions/asl/component/intrinsic/function/statesfunction/states_function_format.py +1 -1
- localstack/services/stepfunctions/asl/component/intrinsic/jsonata.py +1 -1
- localstack/services/stepfunctions/asl/component/program/program.py +1 -1
- localstack/services/stepfunctions/asl/component/program/states.py +1 -1
- localstack/services/stepfunctions/asl/component/state/state_execution/execute_state.py +1 -1
- localstack/services/stepfunctions/asl/component/state/state_execution/state_map/item_reader/item_reader_decl.py +1 -1
- localstack/services/stepfunctions/asl/component/state/state_execution/state_map/item_reader/resource_eval/resource_output_transformer/resource_output_transformer_csv.py +2 -2
- localstack/services/stepfunctions/asl/component/state/state_execution/state_parallel/branches_decl.py +3 -3
- localstack/services/stepfunctions/asl/component/state/state_execution/state_task/lambda_eval_utils.py +1 -1
- localstack/services/stepfunctions/asl/component/state/state_execution/state_task/service/state_task_service_api_gateway.py +3 -3
- localstack/services/stepfunctions/asl/component/state/state_execution/state_task/service/state_task_service_aws_sdk.py +1 -1
- localstack/services/stepfunctions/asl/component/state/state_execution/state_task/service/state_task_service_batch.py +2 -2
- localstack/services/stepfunctions/asl/component/state/state_execution/state_task/state_task.py +1 -1
- localstack/services/stepfunctions/asl/eval/environment.py +6 -6
- localstack/services/stepfunctions/asl/eval/event/event_manager.py +1 -1
- localstack/services/stepfunctions/asl/eval/states.py +1 -1
- localstack/services/stepfunctions/asl/eval/variable_store.py +3 -3
- localstack/services/stepfunctions/asl/jsonata/jsonata.py +1 -1
- localstack/services/stepfunctions/asl/parse/asl_parser.py +1 -1
- localstack/services/stepfunctions/asl/parse/intrinsic/preprocessor.py +1 -1
- localstack/services/stepfunctions/asl/parse/preprocessor.py +14 -14
- localstack/services/stepfunctions/asl/static_analyser/intrinsic/variable_names_intrinsic_static_analyser.py +1 -1
- localstack/services/stepfunctions/asl/static_analyser/variable_references_static_analyser.py +2 -2
- localstack/services/stepfunctions/backend/alias.py +2 -2
- localstack/services/stepfunctions/backend/execution.py +2 -2
- localstack/services/stepfunctions/backend/state_machine.py +2 -2
- localstack/services/stepfunctions/mocking/mock_config.py +4 -4
- localstack/services/stepfunctions/provider.py +7 -7
- localstack/testing/pytest/cloudformation/fixtures.py +4 -4
- localstack/testing/pytest/fixtures.py +2 -2
- localstack/testing/pytest/marking.py +1 -1
- localstack/testing/pytest/stepfunctions/fixtures.py +4 -4
- localstack/testing/pytest/stepfunctions/utils.py +6 -6
- localstack/utils/analytics/metrics/counter.py +3 -3
- localstack/utils/analytics/metrics/registry.py +1 -1
- localstack/utils/scheduler.py +2 -2
- localstack/utils/testutil.py +1 -1
- localstack/version.py +2 -2
- {localstack_core-4.7.1.dev40.dist-info → localstack_core-4.7.1.dev42.dist-info}/METADATA +1 -1
- {localstack_core-4.7.1.dev40.dist-info → localstack_core-4.7.1.dev42.dist-info}/RECORD +86 -86
- localstack_core-4.7.1.dev42.dist-info/plux.json +1 -0
- localstack_core-4.7.1.dev40.dist-info/plux.json +0 -1
- {localstack_core-4.7.1.dev40.data → localstack_core-4.7.1.dev42.data}/scripts/localstack +0 -0
- {localstack_core-4.7.1.dev40.data → localstack_core-4.7.1.dev42.data}/scripts/localstack-supervisor +0 -0
- {localstack_core-4.7.1.dev40.data → localstack_core-4.7.1.dev42.data}/scripts/localstack.bat +0 -0
- {localstack_core-4.7.1.dev40.dist-info → localstack_core-4.7.1.dev42.dist-info}/WHEEL +0 -0
- {localstack_core-4.7.1.dev40.dist-info → localstack_core-4.7.1.dev42.dist-info}/entry_points.txt +0 -0
- {localstack_core-4.7.1.dev40.dist-info → localstack_core-4.7.1.dev42.dist-info}/licenses/LICENSE.txt +0 -0
- {localstack_core-4.7.1.dev40.dist-info → localstack_core-4.7.1.dev42.dist-info}/top_level.txt +0 -0
|
@@ -95,7 +95,7 @@ class StringFormat(StatesFunction):
|
|
|
95
95
|
value_parts: list[str] = list(map(StringFormat._to_str_repr, value))
|
|
96
96
|
return f"[{', '.join(value_parts)}]"
|
|
97
97
|
elif isinstance(value, dict):
|
|
98
|
-
dict_items =
|
|
98
|
+
dict_items = []
|
|
99
99
|
for d_key, d_value in value.items():
|
|
100
100
|
d_value_lit = StringFormat._to_str_repr(d_value)
|
|
101
101
|
dict_items.append(f"{d_key}={d_value_lit}")
|
|
@@ -24,7 +24,7 @@ class StatesFunctionArray(StatesFunction):
|
|
|
24
24
|
|
|
25
25
|
def _eval_body(self, env: Environment) -> None:
|
|
26
26
|
self.argument_list.eval(env=env)
|
|
27
|
-
values: list[Any] =
|
|
27
|
+
values: list[Any] = []
|
|
28
28
|
for _ in range(self.argument_list.size):
|
|
29
29
|
values.append(env.stack.pop())
|
|
30
30
|
values.reverse()
|
|
@@ -41,7 +41,7 @@ class StatesFunctionFormat(StatesFunction):
|
|
|
41
41
|
# TODO: investigate behaviour for incorrect number of arguments in string format.
|
|
42
42
|
self.argument_list.eval(env=env)
|
|
43
43
|
|
|
44
|
-
values: list[Any] =
|
|
44
|
+
values: list[Any] = []
|
|
45
45
|
for _ in range(self.argument_list.size):
|
|
46
46
|
values.append(env.stack.pop())
|
|
47
47
|
string_format: str = values.pop()
|
|
@@ -75,7 +75,7 @@ _DECLARATION_BY_VARIABLE_REFERENCE: Final[dict[VariableReference, str]] = {
|
|
|
75
75
|
def get_intrinsic_functions_declarations(
|
|
76
76
|
variable_references: set[VariableReference],
|
|
77
77
|
) -> VariableDeclarations:
|
|
78
|
-
declarations: list[str] =
|
|
78
|
+
declarations: list[str] = []
|
|
79
79
|
for variable_reference in variable_references:
|
|
80
80
|
declaration: VariableDeclarations | None = _DECLARATION_BY_VARIABLE_REFERENCE.get(
|
|
81
81
|
variable_reference
|
|
@@ -111,7 +111,7 @@ class Program(EvalComponent):
|
|
|
111
111
|
program_state: ProgramState = env.program_state()
|
|
112
112
|
if isinstance(program_state, ProgramError):
|
|
113
113
|
exec_failed_event_details = select_from_typed_dict(
|
|
114
|
-
typed_dict=ExecutionFailedEventDetails, obj=program_state.error or
|
|
114
|
+
typed_dict=ExecutionFailedEventDetails, obj=program_state.error or {}
|
|
115
115
|
)
|
|
116
116
|
env.event_manager.add_event(
|
|
117
117
|
context=env.event_history_context,
|
|
@@ -170,7 +170,7 @@ class ExecutionState(CommonStateField, abc.ABC):
|
|
|
170
170
|
frame: Environment = env.open_frame()
|
|
171
171
|
frame.states.reset(input_value=env.states.get_input())
|
|
172
172
|
frame.stack = copy.deepcopy(env.stack)
|
|
173
|
-
execution_outputs: list[Any] =
|
|
173
|
+
execution_outputs: list[Any] = []
|
|
174
174
|
execution_exceptions: list[Exception | None] = [None]
|
|
175
175
|
terminated_event = threading.Event()
|
|
176
176
|
|
|
@@ -59,9 +59,9 @@ class ResourceOutputTransformerCSV(ResourceOutputTransformer):
|
|
|
59
59
|
)
|
|
60
60
|
raise FailureEventException(failure_event=failure_event)
|
|
61
61
|
|
|
62
|
-
transformed_outputs =
|
|
62
|
+
transformed_outputs = []
|
|
63
63
|
for row in csv_reader_slice:
|
|
64
|
-
transformed_output =
|
|
64
|
+
transformed_output = {}
|
|
65
65
|
for i, header in enumerate(headers):
|
|
66
66
|
transformed_output[header] = row[i] if i < len(row) else ""
|
|
67
67
|
transformed_outputs.append(
|
|
@@ -42,7 +42,7 @@ class BranchWorkerPool(BranchWorker.BranchWorkerComm):
|
|
|
42
42
|
end_program_state: ProgramState = env.program_state()
|
|
43
43
|
if isinstance(end_program_state, ProgramError):
|
|
44
44
|
self._terminated_with_error = select_from_typed_dict(
|
|
45
|
-
typed_dict=ExecutionFailedEventDetails, obj=end_program_state.error or
|
|
45
|
+
typed_dict=ExecutionFailedEventDetails, obj=end_program_state.error or {}
|
|
46
46
|
)
|
|
47
47
|
self._termination_event.set()
|
|
48
48
|
else:
|
|
@@ -67,7 +67,7 @@ class BranchesDecl(EvalComponent):
|
|
|
67
67
|
|
|
68
68
|
branch_worker_pool = BranchWorkerPool(workers_num=len(self.programs))
|
|
69
69
|
|
|
70
|
-
branch_workers: list[BranchWorker] =
|
|
70
|
+
branch_workers: list[BranchWorker] = []
|
|
71
71
|
for program in self.programs:
|
|
72
72
|
# Environment frame for this sub process.
|
|
73
73
|
env_frame: Environment = env.open_inner_frame()
|
|
@@ -103,7 +103,7 @@ class BranchesDecl(EvalComponent):
|
|
|
103
103
|
)
|
|
104
104
|
|
|
105
105
|
# Collect the results and return.
|
|
106
|
-
result_list =
|
|
106
|
+
result_list = []
|
|
107
107
|
|
|
108
108
|
for worker in branch_workers:
|
|
109
109
|
env_frame = worker.env
|
|
@@ -168,7 +168,7 @@ class StateTaskServiceApiGateway(StateTaskServiceCallback):
|
|
|
168
168
|
|
|
169
169
|
@staticmethod
|
|
170
170
|
def _headers_of(parameters: TaskParameters) -> dict | None:
|
|
171
|
-
headers = parameters.get("Headers",
|
|
171
|
+
headers = parameters.get("Headers", {})
|
|
172
172
|
if headers:
|
|
173
173
|
for key in headers.keys():
|
|
174
174
|
# TODO: the following check takes place at parse time.
|
|
@@ -239,8 +239,8 @@ class StateTaskServiceApiGateway(StateTaskServiceCallback):
|
|
|
239
239
|
response_body = response.json()
|
|
240
240
|
except JSONDecodeError:
|
|
241
241
|
response_body = response.text
|
|
242
|
-
if response_body == json.dumps(
|
|
243
|
-
response_body =
|
|
242
|
+
if response_body == json.dumps({}):
|
|
243
|
+
response_body = {}
|
|
244
244
|
|
|
245
245
|
# since we are not using a case-insensitive dict, and we want to remove a header, for server
|
|
246
246
|
# compatibility we should consider both casing variants
|
|
@@ -132,7 +132,7 @@ class StateTaskServiceAwsSdk(StateTaskServiceCallback):
|
|
|
132
132
|
region=resource_runtime_part.region,
|
|
133
133
|
state_credentials=state_credentials,
|
|
134
134
|
)
|
|
135
|
-
response = getattr(api_client, api_action)(**normalised_parameters) or
|
|
135
|
+
response = getattr(api_client, api_action)(**normalised_parameters) or {}
|
|
136
136
|
if response:
|
|
137
137
|
response.pop("ResponseMetadata", None)
|
|
138
138
|
env.stack.append(response)
|
|
@@ -71,12 +71,12 @@ class StateTaskServiceBatch(StateTaskServiceCallback):
|
|
|
71
71
|
# Attaches to the ContainerOverrides environment variables the AWS managed flags.
|
|
72
72
|
container_overrides = parameters.get("ContainerOverrides")
|
|
73
73
|
if container_overrides is None:
|
|
74
|
-
container_overrides =
|
|
74
|
+
container_overrides = {}
|
|
75
75
|
parameters["ContainerOverrides"] = container_overrides
|
|
76
76
|
|
|
77
77
|
environment = container_overrides.get("Environment")
|
|
78
78
|
if environment is None:
|
|
79
|
-
environment =
|
|
79
|
+
environment = []
|
|
80
80
|
container_overrides["Environment"] = environment
|
|
81
81
|
|
|
82
82
|
environment.append(
|
localstack/services/stepfunctions/asl/component/state/state_execution/state_task/state_task.py
CHANGED
|
@@ -51,7 +51,7 @@ class StateTask(ExecutionState, abc.ABC):
|
|
|
51
51
|
|
|
52
52
|
def _eval_parameters(self, env: Environment) -> dict:
|
|
53
53
|
# Eval raw parameters.
|
|
54
|
-
parameters =
|
|
54
|
+
parameters = {}
|
|
55
55
|
if self.parargs is not None:
|
|
56
56
|
self.parargs.eval(env=env)
|
|
57
57
|
parameters = env.stack.pop()
|
|
@@ -57,8 +57,8 @@ class Environment:
|
|
|
57
57
|
_frames: Final[list[Environment]]
|
|
58
58
|
_is_frame: bool = False
|
|
59
59
|
|
|
60
|
-
heap: dict[str, Any] =
|
|
61
|
-
stack: list[Any] =
|
|
60
|
+
heap: dict[str, Any] = {}
|
|
61
|
+
stack: list[Any] = []
|
|
62
62
|
states: Final[States]
|
|
63
63
|
variable_store: Final[VariableStore]
|
|
64
64
|
|
|
@@ -91,11 +91,11 @@ class Environment:
|
|
|
91
91
|
|
|
92
92
|
self.mock_test_case = mock_test_case
|
|
93
93
|
|
|
94
|
-
self._frames =
|
|
94
|
+
self._frames = []
|
|
95
95
|
self._is_frame = False
|
|
96
96
|
|
|
97
|
-
self.heap =
|
|
98
|
-
self.stack =
|
|
97
|
+
self.heap = {}
|
|
98
|
+
self.stack = []
|
|
99
99
|
self.states = States(context=context)
|
|
100
100
|
self.variable_store = variable_store or VariableStore()
|
|
101
101
|
|
|
@@ -148,7 +148,7 @@ class Environment:
|
|
|
148
148
|
)
|
|
149
149
|
frame.callback_pool_manager = env.callback_pool_manager
|
|
150
150
|
frame.map_run_record_pool_manager = env.map_run_record_pool_manager
|
|
151
|
-
frame.heap =
|
|
151
|
+
frame.heap = {}
|
|
152
152
|
frame._program_state = copy.deepcopy(env._program_state)
|
|
153
153
|
return frame
|
|
154
154
|
|
|
@@ -66,7 +66,7 @@ class EventManager:
|
|
|
66
66
|
def __init__(self, cloud_watch_logging_session: CloudWatchLoggingSession | None = None):
|
|
67
67
|
self._mutex = threading.Lock()
|
|
68
68
|
self._event_id_gen = EventIdGenerator()
|
|
69
|
-
self._history_event_list =
|
|
69
|
+
self._history_event_list = []
|
|
70
70
|
self._cloud_watch_logging_session = cloud_watch_logging_session
|
|
71
71
|
|
|
72
72
|
def add_event(
|
|
@@ -55,8 +55,8 @@ class VariableStore:
|
|
|
55
55
|
_variable_declarations_cache: VariableDeclarations | None
|
|
56
56
|
|
|
57
57
|
def __init__(self):
|
|
58
|
-
self._outer_scope =
|
|
59
|
-
self._inner_scope =
|
|
58
|
+
self._outer_scope = {}
|
|
59
|
+
self._inner_scope = {}
|
|
60
60
|
self._declaration_tracing = set()
|
|
61
61
|
self._outer_variable_declaration_cache = None
|
|
62
62
|
self._variable_declarations_cache = None
|
|
@@ -73,7 +73,7 @@ class VariableStore:
|
|
|
73
73
|
|
|
74
74
|
# TODO: add typing when this available in service init.
|
|
75
75
|
def get_assigned_variables(self) -> dict[str, str]:
|
|
76
|
-
assigned_variables: dict[str, str] =
|
|
76
|
+
assigned_variables: dict[str, str] = {}
|
|
77
77
|
for traced_declaration_identifier in self._declaration_tracing:
|
|
78
78
|
traced_declaration_value = self.get(traced_declaration_identifier)
|
|
79
79
|
if isinstance(traced_declaration_value, str):
|
|
@@ -145,7 +145,7 @@ def extract_jsonata_variable_references(
|
|
|
145
145
|
def encode_jsonata_variable_declarations(
|
|
146
146
|
bindings: dict[VariableReference, Any],
|
|
147
147
|
) -> VariableDeclarations:
|
|
148
|
-
declarations_parts: list[str] =
|
|
148
|
+
declarations_parts: list[str] = []
|
|
149
149
|
for variable_reference, value in bindings.items():
|
|
150
150
|
if isinstance(value, str):
|
|
151
151
|
value_str_lit = f'"{value}"'
|
|
@@ -15,7 +15,7 @@ class SyntaxErrorListener(ErrorListener):
|
|
|
15
15
|
|
|
16
16
|
def __init__(self):
|
|
17
17
|
super().__init__()
|
|
18
|
-
self.errors =
|
|
18
|
+
self.errors = []
|
|
19
19
|
|
|
20
20
|
def syntaxError(self, recognizer, offending_symbol, line, column, message, exception):
|
|
21
21
|
log_parts = [f"line {line}:{column}"]
|
|
@@ -85,7 +85,7 @@ class Preprocessor(ASLIntrinsicParserVisitor):
|
|
|
85
85
|
return ArgumentLiteral(definition_value=bool_val)
|
|
86
86
|
|
|
87
87
|
def visitFunc_arg_list(self, ctx: ASLIntrinsicParser.Func_arg_listContext) -> ArgumentList:
|
|
88
|
-
arguments: list[Argument] =
|
|
88
|
+
arguments: list[Argument] = []
|
|
89
89
|
for child in ctx.children:
|
|
90
90
|
cmp: Component | None = self.visit(child)
|
|
91
91
|
if isinstance(cmp, Argument):
|
|
@@ -318,7 +318,7 @@ LOG = logging.getLogger(__name__)
|
|
|
318
318
|
|
|
319
319
|
|
|
320
320
|
class Preprocessor(ASLParserVisitor):
|
|
321
|
-
_query_language_per_scope: list[QueryLanguage] =
|
|
321
|
+
_query_language_per_scope: list[QueryLanguage] = []
|
|
322
322
|
|
|
323
323
|
def _get_current_query_language(self) -> QueryLanguage:
|
|
324
324
|
return self._query_language_per_scope[-1]
|
|
@@ -660,7 +660,7 @@ class Preprocessor(ASLParserVisitor):
|
|
|
660
660
|
self, ctx: ASLParser.Comparison_compositeContext
|
|
661
661
|
) -> ComparisonComposite:
|
|
662
662
|
choice_op: ComparisonComposite.ChoiceOp = self.visit(ctx.choice_operator())
|
|
663
|
-
rules: list[ChoiceRule] =
|
|
663
|
+
rules: list[ChoiceRule] = []
|
|
664
664
|
for child in ctx.children[1:]:
|
|
665
665
|
cmp: Component | None = self.visit(child)
|
|
666
666
|
if not cmp:
|
|
@@ -746,7 +746,7 @@ class Preprocessor(ASLParserVisitor):
|
|
|
746
746
|
)
|
|
747
747
|
|
|
748
748
|
def visitChoices_decl(self, ctx: ASLParser.Choices_declContext) -> ChoicesDecl:
|
|
749
|
-
rules: list[ChoiceRule] =
|
|
749
|
+
rules: list[ChoiceRule] = []
|
|
750
750
|
for child in ctx.children:
|
|
751
751
|
cmp: Component | None = self.visit(child)
|
|
752
752
|
if not cmp:
|
|
@@ -966,7 +966,7 @@ class Preprocessor(ASLParserVisitor):
|
|
|
966
966
|
return CSVHeaderLocation(csv_header_location_value=value)
|
|
967
967
|
|
|
968
968
|
def visitCsv_headers_decl(self, ctx: ASLParser.Csv_headers_declContext) -> CSVHeaders:
|
|
969
|
-
csv_headers: list[str] =
|
|
969
|
+
csv_headers: list[str] = []
|
|
970
970
|
for child in ctx.children[3:-1]:
|
|
971
971
|
maybe_str = is_production(pt=child, rule_index=ASLParser.RULE_string_literal)
|
|
972
972
|
if maybe_str is not None:
|
|
@@ -1074,7 +1074,7 @@ class Preprocessor(ASLParserVisitor):
|
|
|
1074
1074
|
return ResultWriter(resource=resource, parargs=parargs)
|
|
1075
1075
|
|
|
1076
1076
|
def visitRetry_decl(self, ctx: ASLParser.Retry_declContext) -> RetryDecl:
|
|
1077
|
-
retriers: list[RetrierDecl] =
|
|
1077
|
+
retriers: list[RetrierDecl] = []
|
|
1078
1078
|
for child in ctx.children:
|
|
1079
1079
|
cmp: Component | None = self.visit(child)
|
|
1080
1080
|
if isinstance(cmp, RetrierDecl):
|
|
@@ -1092,7 +1092,7 @@ class Preprocessor(ASLParserVisitor):
|
|
|
1092
1092
|
return self.visit(ctx.children[0])
|
|
1093
1093
|
|
|
1094
1094
|
def visitError_equals_decl(self, ctx: ASLParser.Error_equals_declContext) -> ErrorEqualsDecl:
|
|
1095
|
-
error_names: list[ErrorName] =
|
|
1095
|
+
error_names: list[ErrorName] = []
|
|
1096
1096
|
for child in ctx.children:
|
|
1097
1097
|
cmp = self.visit(child)
|
|
1098
1098
|
if isinstance(cmp, ErrorName):
|
|
@@ -1146,7 +1146,7 @@ class Preprocessor(ASLParserVisitor):
|
|
|
1146
1146
|
return JitterStrategyDecl(jitter_strategy=jitter_strategy)
|
|
1147
1147
|
|
|
1148
1148
|
def visitCatch_decl(self, ctx: ASLParser.Catch_declContext) -> CatchDecl:
|
|
1149
|
-
catchers: list[CatcherDecl] =
|
|
1149
|
+
catchers: list[CatcherDecl] = []
|
|
1150
1150
|
for child in ctx.children:
|
|
1151
1151
|
cmp: Component | None = self.visit(child)
|
|
1152
1152
|
if isinstance(cmp, CatcherDecl):
|
|
@@ -1208,7 +1208,7 @@ class Preprocessor(ASLParserVisitor):
|
|
|
1208
1208
|
return PayloadBindingValue(field=string_literal.literal_value, payload_value=payload_value)
|
|
1209
1209
|
|
|
1210
1210
|
def visitPayload_arr_decl(self, ctx: ASLParser.Payload_arr_declContext) -> PayloadArr:
|
|
1211
|
-
payload_values: list[PayloadValue] =
|
|
1211
|
+
payload_values: list[PayloadValue] = []
|
|
1212
1212
|
for child in ctx.children:
|
|
1213
1213
|
cmp: Component | None = self.visit(child)
|
|
1214
1214
|
if isinstance(cmp, PayloadValue):
|
|
@@ -1216,7 +1216,7 @@ class Preprocessor(ASLParserVisitor):
|
|
|
1216
1216
|
return PayloadArr(payload_values=payload_values)
|
|
1217
1217
|
|
|
1218
1218
|
def visitPayload_tmpl_decl(self, ctx: ASLParser.Payload_tmpl_declContext) -> PayloadTmpl:
|
|
1219
|
-
payload_bindings: list[PayloadBinding] =
|
|
1219
|
+
payload_bindings: list[PayloadBinding] = []
|
|
1220
1220
|
for child in ctx.children:
|
|
1221
1221
|
cmp: Component | None = self.visit(child)
|
|
1222
1222
|
if isinstance(cmp, PayloadBinding):
|
|
@@ -1312,7 +1312,7 @@ class Preprocessor(ASLParserVisitor):
|
|
|
1312
1312
|
def visitAssign_template_value_array(
|
|
1313
1313
|
self, ctx: ASLParser.Assign_template_value_arrayContext
|
|
1314
1314
|
) -> AssignTemplateValueArray:
|
|
1315
|
-
values: list[AssignTemplateValue] =
|
|
1315
|
+
values: list[AssignTemplateValue] = []
|
|
1316
1316
|
for child in ctx.children:
|
|
1317
1317
|
cmp: Component | None = self.visit(child)
|
|
1318
1318
|
if isinstance(cmp, AssignTemplateValue):
|
|
@@ -1322,7 +1322,7 @@ class Preprocessor(ASLParserVisitor):
|
|
|
1322
1322
|
def visitAssign_template_value_object(
|
|
1323
1323
|
self, ctx: ASLParser.Assign_template_value_objectContext
|
|
1324
1324
|
) -> AssignTemplateValueObject:
|
|
1325
|
-
bindings: list[AssignTemplateBinding] =
|
|
1325
|
+
bindings: list[AssignTemplateBinding] = []
|
|
1326
1326
|
for child in ctx.children:
|
|
1327
1327
|
cmp: Component | None = self.visit(child)
|
|
1328
1328
|
if isinstance(cmp, AssignTemplateBinding):
|
|
@@ -1359,7 +1359,7 @@ class Preprocessor(ASLParserVisitor):
|
|
|
1359
1359
|
def visitAssign_decl_body(
|
|
1360
1360
|
self, ctx: ASLParser.Assign_decl_bodyContext
|
|
1361
1361
|
) -> list[AssignDeclBinding]:
|
|
1362
|
-
bindings: list[AssignDeclBinding] =
|
|
1362
|
+
bindings: list[AssignDeclBinding] = []
|
|
1363
1363
|
for child in ctx.children:
|
|
1364
1364
|
cmp: Component | None = self.visit(child)
|
|
1365
1365
|
if isinstance(cmp, AssignDeclBinding):
|
|
@@ -1414,7 +1414,7 @@ class Preprocessor(ASLParserVisitor):
|
|
|
1414
1414
|
def visitJsonata_template_value_array(
|
|
1415
1415
|
self, ctx: ASLParser.Jsonata_template_value_arrayContext
|
|
1416
1416
|
) -> JSONataTemplateValueArray:
|
|
1417
|
-
values: list[JSONataTemplateValue] =
|
|
1417
|
+
values: list[JSONataTemplateValue] = []
|
|
1418
1418
|
for child in ctx.children:
|
|
1419
1419
|
cmp: Component | None = self.visit(child)
|
|
1420
1420
|
if isinstance(cmp, JSONataTemplateValue):
|
|
@@ -1424,7 +1424,7 @@ class Preprocessor(ASLParserVisitor):
|
|
|
1424
1424
|
def visitJsonata_template_value_object(
|
|
1425
1425
|
self, ctx: ASLParser.Jsonata_template_value_objectContext
|
|
1426
1426
|
) -> JSONataTemplateValueObject:
|
|
1427
|
-
bindings: list[JSONataTemplateBinding] =
|
|
1427
|
+
bindings: list[JSONataTemplateBinding] = []
|
|
1428
1428
|
for child in ctx.children:
|
|
1429
1429
|
cmp: Component | None = self.visit(child)
|
|
1430
1430
|
if isinstance(cmp, JSONataTemplateBinding):
|
localstack/services/stepfunctions/asl/static_analyser/variable_references_static_analyser.py
CHANGED
|
@@ -30,7 +30,7 @@ class VariableReferencesStaticAnalyser(StaticAnalyser):
|
|
|
30
30
|
|
|
31
31
|
def __init__(self):
|
|
32
32
|
super().__init__()
|
|
33
|
-
self._fringe_state_names =
|
|
33
|
+
self._fringe_state_names = []
|
|
34
34
|
self._variable_references = OrderedDict()
|
|
35
35
|
|
|
36
36
|
def get_variable_references(self) -> VariableReferences:
|
|
@@ -54,7 +54,7 @@ class VariableReferencesStaticAnalyser(StaticAnalyser):
|
|
|
54
54
|
|
|
55
55
|
def _put_variable_name(self, variable_name: VariableName) -> None:
|
|
56
56
|
state_name = self._fringe_state_names[-1]
|
|
57
|
-
variable_name_list: VariableNameList = self._variable_references.get(state_name,
|
|
57
|
+
variable_name_list: VariableNameList = self._variable_references.get(state_name, [])
|
|
58
58
|
if variable_name in variable_name_list:
|
|
59
59
|
return
|
|
60
60
|
variable_name_list.append(variable_name)
|
|
@@ -88,8 +88,8 @@ class Alias:
|
|
|
88
88
|
|
|
89
89
|
if routing_configuration_list:
|
|
90
90
|
self._routing_configuration_list = routing_configuration_list
|
|
91
|
-
self._state_machine_version_arns =
|
|
92
|
-
self._execution_probability_distribution =
|
|
91
|
+
self._state_machine_version_arns = []
|
|
92
|
+
self._execution_probability_distribution = []
|
|
93
93
|
for routing_configuration in routing_configuration_list:
|
|
94
94
|
self._state_machine_version_arns.append(
|
|
95
95
|
routing_configuration["stateMachineVersionArn"]
|
|
@@ -258,7 +258,7 @@ class Execution:
|
|
|
258
258
|
|
|
259
259
|
def to_history_output(self) -> GetExecutionHistoryOutput:
|
|
260
260
|
env = self.exec_worker.env
|
|
261
|
-
event_history: HistoryEventList =
|
|
261
|
+
event_history: HistoryEventList = []
|
|
262
262
|
if env is not None:
|
|
263
263
|
# The execution has not started yet.
|
|
264
264
|
event_history: HistoryEventList = env.event_manager.get_event_history()
|
|
@@ -323,7 +323,7 @@ class Execution:
|
|
|
323
323
|
|
|
324
324
|
def publish_execution_status_change_event(self):
|
|
325
325
|
input_value = (
|
|
326
|
-
|
|
326
|
+
{} if not self.input_data else to_json_str(self.input_data, separators=(",", ":"))
|
|
327
327
|
)
|
|
328
328
|
output_value = (
|
|
329
329
|
None if self.output is None else to_json_str(self.output, separators=(",", ":"))
|
|
@@ -154,7 +154,7 @@ class TagManager:
|
|
|
154
154
|
self._tags.pop(key, None)
|
|
155
155
|
|
|
156
156
|
def to_tag_list(self) -> TagList:
|
|
157
|
-
tag_list =
|
|
157
|
+
tag_list = []
|
|
158
158
|
for key, value in self._tags.items():
|
|
159
159
|
tag_list.append(Tag(key=key, value=value))
|
|
160
160
|
return tag_list
|
|
@@ -191,7 +191,7 @@ class StateMachineRevision(StateMachineInstance):
|
|
|
191
191
|
tags,
|
|
192
192
|
tracing_config,
|
|
193
193
|
)
|
|
194
|
-
self.versions =
|
|
194
|
+
self.versions = {}
|
|
195
195
|
self._version_number = 0
|
|
196
196
|
self.tag_manager = TagManager()
|
|
197
197
|
if tags:
|
|
@@ -56,7 +56,7 @@ class StateMockedResponses:
|
|
|
56
56
|
):
|
|
57
57
|
self.state_name = state_name
|
|
58
58
|
self.mocked_response_name = mocked_response_name
|
|
59
|
-
self.mocked_responses =
|
|
59
|
+
self.mocked_responses = []
|
|
60
60
|
last_range_end: int = -1
|
|
61
61
|
mocked_responses_sorted = sorted(mocked_responses, key=lambda mr: mr.range_start)
|
|
62
62
|
for mocked_response in mocked_responses_sorted:
|
|
@@ -87,7 +87,7 @@ class MockTestCase:
|
|
|
87
87
|
):
|
|
88
88
|
self.state_machine_name = state_machine_name
|
|
89
89
|
self.test_case_name = test_case_name
|
|
90
|
-
self.state_mocked_responses =
|
|
90
|
+
self.state_mocked_responses = {}
|
|
91
91
|
for state_mocked_response in state_mocked_responses_list:
|
|
92
92
|
state_name = state_mocked_response.state_name
|
|
93
93
|
if state_name in self.state_mocked_responses:
|
|
@@ -151,7 +151,7 @@ def _mocked_responses_from_raw(
|
|
|
151
151
|
raise RuntimeError(
|
|
152
152
|
f"No definitions for mocked response '{mocked_response_name}' in the mock configuration file."
|
|
153
153
|
)
|
|
154
|
-
mocked_responses: list[MockedResponse] =
|
|
154
|
+
mocked_responses: list[MockedResponse] = []
|
|
155
155
|
for raw_response_model_range, raw_response_model in raw_response_models.items():
|
|
156
156
|
mocked_response: MockedResponse = _mocked_response_from_raw(
|
|
157
157
|
raw_response_model_range=raw_response_model_range, raw_response_model=raw_response_model
|
|
@@ -187,7 +187,7 @@ def _mock_test_case_from_raw(
|
|
|
187
187
|
f"No definitions for test case '{test_case_name}' and "
|
|
188
188
|
f"state machine '{state_machine_name}' in the mock configuration file."
|
|
189
189
|
)
|
|
190
|
-
state_mocked_responses_list: list[StateMockedResponses] =
|
|
190
|
+
state_mocked_responses_list: list[StateMockedResponses] = []
|
|
191
191
|
for state_name, mocked_response_name in test_case.root.items():
|
|
192
192
|
state_mocked_responses = _state_mocked_responses_from_raw(
|
|
193
193
|
state_name=state_name,
|
|
@@ -817,7 +817,7 @@ class StepFunctionsProvider(StepfunctionsApi, ServiceLifecycleHook):
|
|
|
817
817
|
state_machine_clone = copy.deepcopy(unsafe_state_machine)
|
|
818
818
|
|
|
819
819
|
if input is None:
|
|
820
|
-
input_data =
|
|
820
|
+
input_data = {}
|
|
821
821
|
else:
|
|
822
822
|
try:
|
|
823
823
|
input_data = json.loads(input)
|
|
@@ -906,7 +906,7 @@ class StepFunctionsProvider(StepfunctionsApi, ServiceLifecycleHook):
|
|
|
906
906
|
state_machine_clone = copy.deepcopy(unsafe_state_machine)
|
|
907
907
|
|
|
908
908
|
if input is None:
|
|
909
|
-
input_data =
|
|
909
|
+
input_data = {}
|
|
910
910
|
else:
|
|
911
911
|
try:
|
|
912
912
|
input_data = json.loads(input)
|
|
@@ -1097,7 +1097,7 @@ class StepFunctionsProvider(StepfunctionsApi, ServiceLifecycleHook):
|
|
|
1097
1097
|
if not isinstance(state_machine_revision, StateMachineRevision):
|
|
1098
1098
|
raise InvalidArn(f"Invalid arn: {state_machine_arn}")
|
|
1099
1099
|
|
|
1100
|
-
state_machine_aliases: StateMachineAliasList =
|
|
1100
|
+
state_machine_aliases: StateMachineAliasList = []
|
|
1101
1101
|
valid_token_found = next_token is None
|
|
1102
1102
|
|
|
1103
1103
|
for alias in state_machine_revision.aliases:
|
|
@@ -1141,7 +1141,7 @@ class StepFunctionsProvider(StepfunctionsApi, ServiceLifecycleHook):
|
|
|
1141
1141
|
if not isinstance(state_machine_revision, StateMachineRevision):
|
|
1142
1142
|
raise InvalidArn(f"Invalid arn: {state_machine_arn}")
|
|
1143
1143
|
|
|
1144
|
-
state_machine_version_items =
|
|
1144
|
+
state_machine_version_items = []
|
|
1145
1145
|
for version_arn in state_machine_revision.versions.values():
|
|
1146
1146
|
state_machine_version = state_machines[version_arn]
|
|
1147
1147
|
if isinstance(state_machine_version, StateMachineVersion):
|
|
@@ -1237,7 +1237,7 @@ class StepFunctionsProvider(StepfunctionsApi, ServiceLifecycleHook):
|
|
|
1237
1237
|
if (
|
|
1238
1238
|
state_machine_revision := state_machines.get(state_machine_version.source_arn)
|
|
1239
1239
|
) and isinstance(state_machine_revision, StateMachineRevision):
|
|
1240
|
-
referencing_alias_names: list[str] =
|
|
1240
|
+
referencing_alias_names: list[str] = []
|
|
1241
1241
|
for alias in state_machine_revision.aliases:
|
|
1242
1242
|
if alias.is_router_for(state_machine_version_arn=state_machine_version_arn):
|
|
1243
1243
|
referencing_alias_names.append(alias.name)
|
|
@@ -1635,13 +1635,13 @@ class StepFunctionsProvider(StepfunctionsApi, ServiceLifecycleHook):
|
|
|
1635
1635
|
state_machine_type: StateMachineType = request.get("type", StateMachineType.STANDARD)
|
|
1636
1636
|
definition: str = request["definition"]
|
|
1637
1637
|
|
|
1638
|
-
static_analysers =
|
|
1638
|
+
static_analysers = []
|
|
1639
1639
|
if state_machine_type == StateMachineType.STANDARD:
|
|
1640
1640
|
static_analysers.append(StaticAnalyser())
|
|
1641
1641
|
else:
|
|
1642
1642
|
static_analysers.append(ExpressStaticAnalyser())
|
|
1643
1643
|
|
|
1644
|
-
diagnostics: ValidateStateMachineDefinitionDiagnosticList =
|
|
1644
|
+
diagnostics: ValidateStateMachineDefinitionDiagnosticList = []
|
|
1645
1645
|
try:
|
|
1646
1646
|
StepFunctionsProvider._validate_definition(
|
|
1647
1647
|
definition=definition, static_analysers=static_analysers
|
|
@@ -111,8 +111,8 @@ def capture_per_resource_events(
|
|
|
111
111
|
|
|
112
112
|
|
|
113
113
|
def _normalise_describe_change_set_output(value: DescribeChangeSetOutput) -> None:
|
|
114
|
-
value.get("Changes",
|
|
115
|
-
key=lambda change: change.get("ResourceChange",
|
|
114
|
+
value.get("Changes", []).sort(
|
|
115
|
+
key=lambda change: change.get("ResourceChange", {}).get("LogicalResourceId", "")
|
|
116
116
|
)
|
|
117
117
|
|
|
118
118
|
|
|
@@ -175,7 +175,7 @@ def capture_update_process(aws_client_no_retry, cleanups, capture_per_resource_e
|
|
|
175
175
|
cleanups.append(
|
|
176
176
|
lambda: call_safe(
|
|
177
177
|
aws_client_no_retry.cloudformation.delete_change_set,
|
|
178
|
-
kwargs=
|
|
178
|
+
kwargs={"ChangeSetName": change_set_id},
|
|
179
179
|
)
|
|
180
180
|
)
|
|
181
181
|
|
|
@@ -206,7 +206,7 @@ def capture_update_process(aws_client_no_retry, cleanups, capture_per_resource_e
|
|
|
206
206
|
# ensure stack deletion
|
|
207
207
|
cleanups.append(
|
|
208
208
|
lambda: call_safe(
|
|
209
|
-
aws_client_no_retry.cloudformation.delete_stack, kwargs=
|
|
209
|
+
aws_client_no_retry.cloudformation.delete_stack, kwargs={"StackName": stack_id}
|
|
210
210
|
)
|
|
211
211
|
)
|
|
212
212
|
|