IqrOutlierCheck: without rows in the days before, the run crashes with a TypeError
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- data-engineering, testing-qa
Research direction
Start with IqrOutlierCheck._check and DataQualityCheck.check in src/koality/checks.py, using the issue's reproduction YAML to confirm the crash when earlier rows are absent. Handle the NULL quartiles so the check returns a FAIL or ERROR with a message that there is no history for computing quartiles; done means koality run reports that result instead of a traceback.
Written by the indexing model from the issue text.
Description
When the checked day has rows but none of the `interval_days` days before it does (e.g. a new table), `IqrOutlierCheck`'s quartiles are NULL, so `_check` sets `lower_threshold`/`upper_threshold` to `None`. `DataQualityCheck.check` then compares `None <= value`, which raises:
```
TypeError: '<=' not supported between instances of 'NoneType' and 'float'
```
The exception isn't caught, so `koality run` prints a traceback and exits with 2 instead of giving the check a `FAIL` (or `ERROR`) result.
Reproduce:
```yaml
name: t
database_setup: "CREATE TABLE t AS SELECT DATE '2024-01-31' AS d, 5 AS v"
database_accessor: ""
defaults:
filters:
p: {column: d, value: "2024-01-31", type: date}
check_bundles:
- name: b
checks:- {check_type: IqrOutlierCheck, table: t, check_column: v, interval_days: 7, how: both, iqr_factor: 1.5}
```
- {check_type: IqrOutlierCheck, table: t, check_column: v, interval_days: 7, how: both, iqr_factor: 1.5}
Where: `src/koality/checks.py`, `IqrOutlierCheck._check` (takes the NULL thresholds over) and `DataQualityCheck.check` (compares them).
Expected: the check fails (like any check whose value can't be compared), with a message saying there's no history to compute the quartiles from.
- Dominant language
- Python
- Stars
- 4
- Forks
- 3
- Avg merge
- 28m
- Merged PRs (30d)
- 47
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ottogroup/koality
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
All issues in ottogroup/koality
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
daniel-ospina/tortoise#15308 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
difficulty:easy prio:low type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
NatronGitHub/Natron#2405 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Jstar269/nakagawa-recomp#3746 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
jellyfin/jellyfin-mpv-shim#886 ·