Skip to content

Commit e407b10

Browse files
authored
fix: allow whitespaces at end of expression (#121)
fix: allow whitespaces at end of line
1 parent b916bb7 commit e407b10

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/data_factory_testing_framework/_expression_runtime/data_factory_expression/expression_transformer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def __init__(self) -> None:
4040

4141
expression_grammar = f"""
4242
expression_start: "@" expression_evaluation
43-
expression_evaluation: (expression_logical_bool | expression_branch | expression_call) ((("." EXPRESSION_PARAMETER_NAME) | EXPRESSION_ARRAY_INDEX)+)?
43+
expression_evaluation: (expression_logical_bool | expression_branch | expression_call) ((("." EXPRESSION_PARAMETER_NAME) | EXPRESSION_ARRAY_INDEX)+)? EXPRESSION_WS*
4444
?expression_call: expression_function_call
4545
// used to translate to expression_pipeline_reference
4646
| expression_datafactory_parameters_reference

tests/unit/functions/test_data_factory_testing_framework_expression_evaluator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@
120120
id="linked_service_reference",
121121
),
122122
p("@item()", PipelineRunState(iteration_item="value"), "@item()", "value", id="item_reference"),
123+
p("@item() ", PipelineRunState(iteration_item="value"), "@item() ", "value", id="item_reference_with_ws"),
123124
p("@concat('a', 'b' )", PipelineRunState(), "@concat('a', 'b' )", "ab", id="function_call"),
124125
p(
125126
"@concat('https://example.com/jobs/', '123''', concat('&', 'abc,'))",

0 commit comments

Comments
 (0)