-
Notifications
You must be signed in to change notification settings - Fork 167
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
Bug: CLI vars are not properly split when containing commas #1737
Comments
This is actually a unix thing, you can test it by running:
So the quotes are actually gone before they reach the CLI. If you put backslashes in before the quotes, you should get the desired functionality though:
|
@Ekrekr Have you tested that workaround? I'm not seeing the expected behaviour either: dataform compile --default-database "some-db" --default-location "US" --default-schema "some-schema" --vars MY_VAR_1=\"var1,FAKE_VAR=test\",MY_VAR_2=\"var2\" --json Results in: {
"projectConfig": {
"warehouse": "bigquery",
"defaultSchema": "some-schema",
"defaultDatabase": "some-db",
"vars": {
"MY_VAR_1": "\"var1",
"FAKE_VAR": "test\"",
"MY_VAR_2": "\"var2\""
},
"defaultLocation": "US"
},
"graphErrors": {},
"dataformCoreVersion": "3.0.0"
} What you said about quotes not reaching the CLI is correct. However, the CLI code itself is not prepared to handle quotes properly. The example shows two things:
|
Still, closer! Would love if you could submit a patch for this. |
Hey, I have a similar issue, where one of my vars is a JSON string. datafrom run --vars='some_ids=[1,2,3],other_var=other_value' What I would expect in the dataform is: session.projectConfig.vars.some_ids == '[1,2,3]'
session.projectConfig.vars.other_var == 'other_value' So that I can then @Ekrekr Could You explain a bit more how can I pass a string containing a comma into dataform? PS.: |
Variables passed using
--vars
are not properly split when containing commas.Reproduce
Run
daform compile --vars MY_VAR_1="var1,FAKE_VAR=test",MY_VAR_2="var2"
Expected
dataform.projectConfig.vars
value:Actual
dataform.projectConfig.vars
value:Version:
3.0.0-beta.4
UPDATE: still happening on version3.0.0
.Related code:
dataform/cli/index.ts
Lines 690 to 696 in f23795a
The text was updated successfully, but these errors were encountered: