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

Action inputs are not available if args was not used during the action call #861

Open
YevheniiSemendiak opened this issue Jun 15, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@YevheniiSemendiak
Copy link
Collaborator

Action inputs with their default values can not be accessed if args is not specified during the action call:

live.yaml:

kind: live

jobs:
  test:
    action: ws:action.yaml

action.yaml:

kind: live

inputs:
  some_input:
    default: "12"

job:
  image: ubuntu
  bash: |
    echo ${{ inputs.some_input }}

result:

nf run test
ERROR: No attribute some_input
  in "/Users/ysem/work/projects/TMP/action_imputs/action.yaml", line 9, column 18
Traceback (most recent call last):
  File "/Users/ysem/.local/pipx/venvs/neuro-all/lib/python3.9/site-packages/neuro_flow/expr.py", line 581, in eval
    return obj[self.name]
KeyError: 'some_input'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/ysem/.local/pipx/venvs/neuro-all/lib/python3.9/site-packages/neuro_flow/cli/main.py", line 210, in main
    cli.main(args=args, standalone_mode=False)
  File "/Users/ysem/.local/pipx/venvs/neuro-all/lib/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/Users/ysem/.local/pipx/venvs/neuro-all/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/ysem/.local/pipx/venvs/neuro-all/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/ysem/.local/pipx/venvs/neuro-all/lib/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/Users/ysem/.local/pipx/venvs/neuro-all/lib/python3.9/site-packages/click/decorators.py", line 38, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "/Users/ysem/.local/pipx/venvs/neuro-all/lib/python3.9/site-packages/neuro_flow/cli/utils.py", line 40, in wrapper
    return runner.run(callback(*args, **kwargs))
  File "/Users/ysem/.local/pipx/venvs/neuro-all/lib/python3.9/site-packages/neuro_cli/asyncio_utils.py", line 53, in run
    return self._loop.run_until_complete(main_task)
  File "/Users/ysem/miniconda3/envs/neuro/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/Users/ysem/.local/pipx/venvs/neuro-all/lib/python3.9/site-packages/neuro_flow/cli/live.py", line 77, in run
    await runner.run(
  File "/Users/ysem/.local/pipx/venvs/neuro-all/lib/python3.9/site-packages/neuro_flow/live_runner.py", line 376, in run
    job = await self.flow.get_job(job_id, params)
  File "/Users/ysem/.local/pipx/venvs/neuro-all/lib/python3.9/site-packages/neuro_flow/context.py", line 1414, in get_job
    return await self._get_job(ctx, ctx.env, self._defaults, job_id)
  File "/Users/ysem/.local/pipx/venvs/neuro-all/lib/python3.9/site-packages/neuro_flow/context.py", line 1523, in _get_job
    cmd=await job.cmd.eval(ctx),
  File "/Users/ysem/.local/pipx/venvs/neuro-all/lib/python3.9/site-packages/neuro_flow/expr.py", line 1206, in eval
    val = await part.eval(root)
  File "/Users/ysem/.local/pipx/venvs/neuro-all/lib/python3.9/site-packages/neuro_flow/expr.py", line 624, in eval
    ret = await op.eval(root, ret, start)
  File "/Users/ysem/.local/pipx/venvs/neuro-all/lib/python3.9/site-packages/neuro_flow/expr.py", line 583, in eval
    raise EvalError(f"No attribute {self.name}", start, self.end)
neuro_flow.expr.EvalError: No attribute some_input
  in "/Users/ysem/work/projects/TMP/action_imputs/action.yaml", line 9, column 18
@YevheniiSemendiak YevheniiSemendiak added the bug Something isn't working label Jun 15, 2022
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