You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#!/usr/bin/env bash
# tester.sh
printf "TEST_PARAM is %s | TEST_PARAM2 is %s\n" "$TEST_PARAM" "$TEST_PARAM2"
echo $TEST_PARAM/and/path
echo $ENV_PARAM/and/path
Results in output:
TEST_PARAM is "something" | TEST_PARAM2 is "SOMETHING ELSE"
"something"/and/path
something/and/path
Which is interpreted subtly differently in the inner script and caused me to debug and workaround it for a dag.
What I expect as output is:
TEST_PARAM is something | TEST_PARAM2 is SOMETHING ELSE
something/and/path
something/and/path
Note the difference for TEST_PARAM and ENV_PARAM. We can't leave off the quote marks for params, otherwise the arguments are parsed incorrectly by splitting on whitespace.
Because some users could rely on this behavior, one solution is to enable params key to take more structured data, like env: key.
If taking this approach, the way I think it can keep backwards compatibility is to support both single string and structured map as arguments to params for a period of versions.
Before I dig into where this is happening and offer a code fix:
Does this sound like an issue to you or is there something I'm doing wrong with using dagu?
Do you have preferences on the solution before I start prototyping?
Thanks @yohamta !
The text was updated successfully, but these errors were encountered:
Expectation: using params or env vars would both inject environmental variables into any subprocesses executed in the DAG.
Actual: they both inject env vars but differ in how they treat quotes.
Test dag:
Results in output:
Which is interpreted subtly differently in the inner script and caused me to debug and workaround it for a dag.
What I expect as output is:
Note the difference for TEST_PARAM and ENV_PARAM. We can't leave off the quote marks for params, otherwise the arguments are parsed incorrectly by splitting on whitespace.
Because some users could rely on this behavior, one solution is to enable
params
key to take more structured data, likeenv:
key.Like this:
If taking this approach, the way I think it can keep backwards compatibility is to support both single string and structured map as arguments to params for a period of versions.
Before I dig into where this is happening and offer a code fix:
Thanks @yohamta !
The text was updated successfully, but these errors were encountered: