Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

startswith incorrect casing #142

Closed
deenairn opened this issue Dec 10, 2024 · 1 comment · Fixed by #143
Closed

startswith incorrect casing #142

deenairn opened this issue Dec 10, 2024 · 1 comment · Fixed by #143
Assignees

Comments

@deenairn
Copy link
Contributor

When using the default casing for Azure Data Factory, startswith fails (it forces lower casing, but can be written startsWith).

I expect if the other targets use startsWith then a shim is needed for startswith, as you would default to startswith in Azure Data Factory (although it's fixable by using startsWith but this is not what the user interface would provide you with as the option.

Reproduction steps

  • Create a conditional experession in ADF using startswith
  • Run on the test framework
  • Error in relation to failing to find startswith
error.py::test_error_list_non_empty failed: self = <data_factory_testing_framework._expression_runtime.data_factory_expression.expression_transformer.ExpressionTransformer object at 0x00000261661F43E0>
expression = '@startswith(activity(\'Activity\').output.value, 'SomeText'))'
state = <data_factory_testing_framework.state._pipeline_run_state.PipelineRunState object at 0x00000261649B14F0>

    def transform_to_dftf_evaluator_expression(self, expression: str, state: PipelineRunState) -> DataFactoryObjectType:
        try:
>           parse_tree = self._parse(expression)

.venv\Lib\site-packages\data_factory_testing_framework\_expression_runtime\data_factory_expression\expression_transformer.py:118: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.venv\Lib\site-packages\data_factory_testing_framework\_expression_runtime\data_factory_expression\expression_transformer.py:113: in _parse
    tree = self.lark_parser.parse(expression)
.venv\Lib\site-packages\lark\lark.py:655: in parse
    return self.parser.parse(text, start=start, on_error=on_error)
.venv\Lib\site-packages\lark\parser_frontends.py:104: in parse
    return self.parser.parse(stream, chosen_start, **kw)
.venv\Lib\site-packages\lark\parsers\earley.py:280: in parse
    to_scan = self._parse(lexer, columns, to_scan, start_symbol)
.venv\Lib\site-packages\lark\parsers\xearley.py:152: in _parse
    to_scan = scan(i, to_scan)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

i = 46
@LeonardHd
Copy link
Collaborator

Hi @deenairn thank you for all the great feedback and testing.
I fixed this by making all function names case insensitive.
There should be a new release available on pypi (https://pypi.org/project/data-factory-testing-framework/1.1.10/).

Looking forward to getting more feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants