generated from adrienaury/go-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add column alias in config (#17)
* feat: column alias * fix: double config read * fix: excluding numeric values
- Loading branch information
1 parent
0fcec45
commit 97943be
Showing
10 changed files
with
197 additions
and
15 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
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,4 @@ | ||
version: "1" | ||
metrics: | ||
- name: "value_renamed" | ||
alias: "value" |
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,4 @@ | ||
version: "1" | ||
metrics: | ||
- name: "value" | ||
exclude: [2] |
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,40 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>MIMO Report</title> | ||
<meta name="viewport" content="width=device-width,initial-scale=1" /> | ||
<meta name="description" content="MIMO Report" /> | ||
</head> | ||
<body> | ||
<h1>MIMO Report</h1> | ||
<table border="1" cellspacing="0" cellpadding="5"> | ||
<thead> | ||
<th>Field</th> | ||
<th>Nil</th> | ||
<th>Empty</th> | ||
<th>Masked</th> | ||
<th>Missed</th> | ||
<th>Masking Rate</th> | ||
<th>Coherent Rate</th> | ||
<th>Identifiable Rate</th> | ||
<th>K</th> | ||
</thead> | ||
<tbody> | ||
|
||
<tr> | ||
<td>value</td> | ||
<td>0</td> | ||
<td>1</td> | ||
<td>3</td> | ||
<td>0</td> | ||
<td style="background-color: lightgreen">100.00 %</td> | ||
<td style="background-color: lightgreen">100.00 %</td> | ||
<td style="background-color: lightgreen">100.00 %</td> | ||
<td style="background-color: orange">1</td> | ||
</tr> | ||
|
||
</tbody> | ||
</table> | ||
</body> | ||
</html> |
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,40 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>MIMO Report</title> | ||
<meta name="viewport" content="width=device-width,initial-scale=1" /> | ||
<meta name="description" content="MIMO Report" /> | ||
</head> | ||
<body> | ||
<h1>MIMO Report</h1> | ||
<table border="1" cellspacing="0" cellpadding="5"> | ||
<thead> | ||
<th>Field</th> | ||
<th>Nil</th> | ||
<th>Empty</th> | ||
<th>Masked</th> | ||
<th>Missed</th> | ||
<th>Masking Rate</th> | ||
<th>Coherent Rate</th> | ||
<th>Identifiable Rate</th> | ||
<th>K</th> | ||
</thead> | ||
<tbody> | ||
|
||
<tr> | ||
<td>value</td> | ||
<td>1</td> | ||
<td>0</td> | ||
<td>4</td> | ||
<td>1</td> | ||
<td style="background-color: orange">80.00 %</td> | ||
<td style="background-color: orange">66.67 %</td> | ||
<td style="background-color: orange">60.00 %</td> | ||
<td style="background-color: orange">1</td> | ||
</tr> | ||
|
||
</tbody> | ||
</table> | ||
</body> | ||
</html> |
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,46 @@ | ||
# Venom Test Suite definition | ||
# Check Venom documentation for more information : https://github.com/ovh/venom | ||
name: use of columns aliases | ||
testcases: | ||
- name: reuse previous data directory with column alias | ||
steps: | ||
- script: rm -rf working/data | ||
|
||
- script: echo '{"value":"A"}' > working/real.jsonl | ||
- script: echo '{"value":"A"}' >> working/real.jsonl | ||
- script: echo '{"value":"B"}' >> working/real.jsonl | ||
- script: echo '{"value":"B"}' >> working/real.jsonl | ||
- script: echo '{"value":"C"}' >> working/real.jsonl | ||
|
||
- script: echo '{"value":"X"}' > working/masked.jsonl | ||
- script: echo '{"value":"Y"}' >> working/masked.jsonl | ||
- script: echo '{"value":"C"}' >> working/masked.jsonl | ||
- script: echo '{"value":"C"}' >> working/masked.jsonl | ||
- script: echo '{"value":"C"}' >> working/masked.jsonl | ||
|
||
- script: cat working/masked.jsonl | mimo -v3 --disk-storage --persist working/data/ working/real.jsonl | ||
|
||
- script: echo '{"value_renamed":"C"}' > working/real.jsonl | ||
- script: echo '{"value_renamed":"D"}' >> working/real.jsonl | ||
- script: echo '{"value_renamed":"D"}' >> working/real.jsonl | ||
- script: echo '{"value_renamed":"E"}' >> working/real.jsonl | ||
- script: echo '{"value_renamed":"E"}' >> working/real.jsonl | ||
- script: echo '{"value_renamed":null}' >> working/real.jsonl | ||
- script: echo '{}' >> working/real.jsonl | ||
- script: echo '{"object":{"hello":{}}}' >> working/real.jsonl | ||
|
||
- script: echo '{"value_renamed":"C"}' > working/masked.jsonl | ||
- script: echo '{"value_renamed":"W"}' >> working/masked.jsonl | ||
- script: echo '{"value_renamed":"W"}' >> working/masked.jsonl | ||
- script: echo '{"value_renamed":"V"}' >> working/masked.jsonl | ||
- script: echo '{"value_renamed":"C"}' >> working/masked.jsonl | ||
- script: echo '{"value_renamed":"W"}' >> working/masked.jsonl | ||
- script: echo '{}' >> working/masked.jsonl | ||
- script: echo '{"object":{"hello":{}}}' >> working/masked.jsonl | ||
|
||
- script: cat working/masked.jsonl | mimo -v5 --config ../configs/config_alias.yaml --disk-storage --persist working/data/ working/real.jsonl | ||
assertions: | ||
- result.code ShouldEqual 0 | ||
- result.systemerr ShouldContainSubstring value count-empty=0 count-masked=4 count-missed=1 count-nil=1 field=value rate-coherence=0.6666666666666666 rate-identifiable=0.6 rate-masking=0.8 | ||
|
||
- script: mv report.html ../reports/report_reuse_previous_alias.html |
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