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

SwitchTask has some issue with snake case to camelcase conversion #62

Open
lhajabacs opened this issue Aug 8, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@lhajabacs
Copy link

Description

need to use 'switchCaseValue' but the input has 'switch_case_value'.
Because of this automatic conversion it does not work - never hits any case.

switch = SwitchTask(
                name="switch",
                task_reference_name="switch",
                decision_cases={
                    "true": [
                        tx_start_1,
                        uniconfig_sync_from_network,
                        uniconfig_replace_config_with_oper,
                        commit_tx_1,
                    ]},
                default_case=[
                ],

                # expression="switch_case_value", # this should work
                expression="switchCaseValue",  #this hack makes it work
                evaluator_type=SwitchEvaluatorType.VALUE_PARAM,

                # expression="$.switch_case_value == 'true' ? 'true' : 'false'",
                # evaluator_type=SwitchEvaluatorType.JAVASCRIPT,

                input_parameters=SwitchTaskValueParamInputParameters(
                    switch_case_value="${workflow.input.need_synchronization}"   #this is the actual input
                )
            )

Example Code

No response

Python, Poetry & Packages Version

Virtualenv
Python:         3.12.3
Implementation: CPython
Path:           /home/laco/.cache/pypoetry/virtualenvs/nos-v-p0TpFf-py3.12
Executable:     /home/laco/.cache/pypoetry/virtualenvs/nos-v-p0TpFf-py3.12/bin/python
Valid:          True

Base
Platform:   linux
OS:         posix
Python:     3.12.3
Path:       /usr
Executable: /usr/bin/python3.12


aiohttp                    3.9.5           Async http client/server framework (asyncio)
aiosignal                  1.3.1           aiosignal: a list of registered asynchronous callbacks
annotated-types            0.7.0           Reusable constraint types to use with typing.Annotated
attrs                      23.2.0          Classes Without Boilerplate
certifi                    2024.7.4        Python package for providing Mozilla's CA Bundle.
charset-normalizer         3.3.2           The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet.
frinx-inventory-api        2.1.1 312ccaf   Frinx Inventory graphql schema transformed to pydantic basemodels
frinx-inventory-worker     1.2.2 ec690ba   Conductor worker for Frinx Device Inventory
frinx-python-sdk           2.1.3           Python SDK for Frinx Machine Workflow Manager
frinx-schellar-api         1.0.1 312ccaf   Frinx Schellar graphql schema transformed to pydantic basemodels
frinx-schellar-worker      1.1.1 912b0ed   Conductor worker for Schellar service
frinx-uniconfig-api        1.2.1 312ccaf   Python SDK for Frinx Machine Workflow Manager
frinx-uniconfig-worker     2.3.6 912b0ed   Conductor worker for Frinx Uniconfig
frozenlist                 1.4.1           A list-like structure which implements collections.abc.MutableSequence
graphql-pydantic-converter 1.2.2           Convert pydantic schema to pydantic datamodel and build request from it
idna                       3.7             Internationalized Domain Names in Applications (IDNA)
iniconfig                  2.0.0           brain-dead simple config-ini parsing
multidict                  6.0.5           multidict implementation
mypy                       1.11.0          Optional static typing for Python
mypy-extensions            1.0.0           Type system extensions for programs checked with the mypy type checker.
nodeenv                    1.9.1           Node.js virtual environment builder
packaging                  24.1            Core utilities for Python packages
pluggy                     1.5.0           plugin and hook calling mechanisms for python
prometheus-client          0.20.0          Python client for the Prometheus monitoring system.
pydantic                   2.5.3           Data validation using Python type hints
pydantic-core              2.14.6          
pyright                    1.1.373         Command line wrapper for pyright
pytest                     8.3.2           pytest: simple powerful testing with Python
python-dotenv              1.0.1           Read key-value pairs from a .env file and set them as environment variables
requests                   2.32.3          Python HTTP for Humans.
ruff                       0.0.263         An extremely fast Python linter, written in Rust.
types-requests             2.32.0.20240712 Typing stubs for requests
typing-extensions          4.12.2          Backported and Experimental Type Hints for Python 3.8+
urllib3                    2.2.2           HTTP library with thread-safe connection pooling, file post, and more.
websockets                 12.0            An implementation of the WebSocket Protocol (RFC 6455 & 7692)
yarl                       1.9.4           Yet another URL library


Poetry (version 1.8.2)
@lhajabacs lhajabacs added the bug Something isn't working label Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant