Skip to content

Commit

Permalink
feat: boolean columns (tests) (#219): add booleanEquals tests
Browse files Browse the repository at this point in the history
Test results were verified using
https://github.com/pflanze/ndjson-updater/.

In `booleanEquals_Or.json`, `"value": "B.1"` would return `"count":
97`, but the second subquery would include all of those from the first
hence not so interesting, thus `"B.1.1"` was chosen.
  • Loading branch information
pflanze committed Apr 10, 2024
1 parent ebd9008 commit ab810c7
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 0 deletions.
18 changes: 18 additions & 0 deletions endToEndTests/test/queries/booleanEquals.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"testCaseName": "BooleanEquals for test_boolean_column",
"query": {
"action": {
"type": "Aggregated"
},
"filterExpression": {
"type": "BooleanEquals",
"column": "test_boolean_column",
"value": true
}
},
"expectedQueryResult": [
{
"count": 41
}
]
}
29 changes: 29 additions & 0 deletions endToEndTests/test/queries/booleanEquals_And.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"testCaseName": "BooleanEquals with And",
"query": {
"action": {
"type": "Aggregated"
},
"filterExpression": {
"type": "And",
"children": [
{
"type": "BooleanEquals",
"column": "test_boolean_column",
"value": false
},
{
"type": "PangoLineage",
"column": "pango_lineage",
"value": "B.1",
"includeSublineages": true
}
]
}
},
"expectedQueryResult": [
{
"count": 37
}
]
}
29 changes: 29 additions & 0 deletions endToEndTests/test/queries/booleanEquals_Or.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"testCaseName": "BooleanEquals with Or",
"query": {
"action": {
"type": "Aggregated"
},
"filterExpression": {
"type": "Or",
"children": [
{
"type": "BooleanEquals",
"column": "test_boolean_column",
"value": null
},
{
"type": "PangoLineage",
"column": "pango_lineage",
"value": "B.1.1",
"includeSublineages": true
}
]
}
},
"expectedQueryResult": [
{
"count": 68
}
]
}
56 changes: 56 additions & 0 deletions endToEndTests/test/queries/boolean_Details.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"testCaseName": "boolean Details",
"query": {
"action": {
"type": "Details",
"fields": ["test_boolean_column", "gisaid_epi_isl"],
"orderByFields": ["gisaid_epi_isl"],
"limit": 10
},
"filterExpression": {
"type": "True"
}
},
"expectedQueryResult": [
{
"gisaid_epi_isl": "EPI_ISL_1001493",
"test_boolean_column": true
},
{
"gisaid_epi_isl": "EPI_ISL_1001920",
"test_boolean_column": false
},
{
"gisaid_epi_isl": "EPI_ISL_1002052",
"test_boolean_column": true
},
{
"gisaid_epi_isl": "EPI_ISL_1002156",
"test_boolean_column": true
},
{
"gisaid_epi_isl": "EPI_ISL_1003010",
"test_boolean_column": true
},
{
"gisaid_epi_isl": "EPI_ISL_1003036",
"test_boolean_column": null
},
{
"gisaid_epi_isl": "EPI_ISL_1003373",
"test_boolean_column": false
},
{
"gisaid_epi_isl": "EPI_ISL_1003425",
"test_boolean_column": true
},
{
"gisaid_epi_isl": "EPI_ISL_1003519",
"test_boolean_column": false
},
{
"gisaid_epi_isl": "EPI_ISL_1003629",
"test_boolean_column": null
}
]
}

0 comments on commit ab810c7

Please sign in to comment.