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

fix: do not evaluate inputs and outputs in mappings during loadtime #940

Closed
wants to merge 3 commits into from
Closed

fix: do not evaluate inputs and outputs in mappings during loadtime #940

wants to merge 3 commits into from

Conversation

gurjotkaur20
Copy link
Contributor

Fixes #939

@gurjotkaur20 gurjotkaur20 changed the base branch from v2 to v2-dev January 29, 2024 06:41
@ghost
Copy link

ghost commented Jan 29, 2024

I think this would not suffice the complete requirement. Consider the below workflow example which is using the same mappings object as given in the issue:

summary: Fetch user
tasks:
  - id: mysql_user_one
    fn: datasource.mysql.user.findUnique
    args: <% mappings[config.bname].user.get %>

The expectation is that mappings inputs variable should get evaluated at the workflow execution time. But here id is passed as it is. Below are the args after evaluation:

{
  "where": {
    "id": "<% inputs.params.id %>"
  },
  "select": {
    "id": true,
    "name": true,
    "email": true,
    "enabled": true,
    "roles": {
      "select": {
        "name": true
      }
    }
  },
  "bName": "bankA",
  "cName": {
    "type": "string"
  }
}

This needs re-design of the script compilation/evaluation. So keeping this issue as open for now.

@ghost ghost closed this Jan 29, 2024
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Not able to use inputs and output in mappings as placeholders
1 participant