-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #122 from opencultureconsulting/121-transform-grel…
…-expression-containing-fails fix bug that occurs when GREL contains brackets
- Loading branch information
Showing
5 changed files
with
54 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# orcli 0.2.1 | ||
# orcli 0.2.2 | ||
|
||
## command help screens | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/bash | ||
|
||
t="transform-bracket" | ||
|
||
# create tmp directory | ||
tmpdir="$(mktemp -d)" | ||
trap '{ rm -rf "${tmpdir}"; }' 0 2 3 15 | ||
|
||
# assertion | ||
cat << "DATA" > "${tmpdir}/${t}.assert" | ||
email name test state gender purchase | ||
[email protected] Danny Baron (Danny Baron) CA M TV | ||
[email protected] Melanie White (Melanie White) NC F iPhone | ||
[email protected] D. Baron (D. Baron) CA M Winter jacket | ||
[email protected] Ben Tyler (Ben Tyler) NV M Flashlight | ||
[email protected] Arthur Duff (Arthur Duff) OR M Dining table | ||
[email protected] Daniel Baron (Daniel Baron) CA M Bike | ||
[email protected] Jean Griffith (Jean Griffith) WA F Power drill | ||
[email protected] Melanie White (Melanie White) NC F iPad | ||
[email protected] Ben Morisson (Ben Morisson) FL M Amplifier | ||
[email protected] Arthur Duff (Arthur Duff) OR M Night table | ||
DATA | ||
|
||
# transform | ||
cat << "DATA" > "${tmpdir}/${t}.history" | ||
[ | ||
{ | ||
"op": "core/column-addition", | ||
"engineConfig": { | ||
"facets": [], | ||
"mode": "row-based" | ||
}, | ||
"baseColumnName": "name", | ||
"expression": "grel:forNonBlank(value, x, '(' + x + ')', null)", | ||
"newColumnName": "test", | ||
"columnInsertIndex": 2 | ||
} | ||
] | ||
DATA | ||
|
||
# action | ||
cd "${tmpdir}" || exit 1 | ||
orcli import csv "https://git.io/fj5hF" --projectName "duplicates" | ||
orcli transform "duplicates" "${t}.history" | ||
orcli export tsv "duplicates" --output "${t}.output" | ||
|
||
# test | ||
diff -u "${t}.assert" "${t}.output" |