-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Query schedule fails if there "Until" field equals None #3341
Comments
@arikfr How bow compacting before saving? Would be more space efficient as well? Before: save() {
...
if (newSchedule.interval) {
this.props.updateQuery({ schedule: clone(newSchedule) });
} else {
this.props.updateQuery({ schedule: null });
}
...
} After: import { chain, isNil } from 'lodash';
save() {
...
const schedule = chain(newSchedule).clone().omitBy(isNil);
this.props.updateQuery({ schedule });
...
} |
@ranbena it sounds like a good idea to compact the values. But will the new version you suggested result in |
Bahhh.. I'll submit a tested front end PR. |
@denisov-vlad I'm looking at the exception you got and I think it happens because If you run this code:
You can see that it works as expected. But if you try the following --
It generates the error you got. The strange part is that we load only queries with schedule is not null: redash/redash/models/__init__.py Line 555 in bd559b6
So I'm not sure how you got this error 🤔 |
To make the logic there easier to follow, I rewrote it a bit in 91ba67c. |
@denisov-vlad did you manage to reproduce this or understand why it happens? |
I've found that empty schedule had two types of null values: real NULL and 'null' as string. I've replaced 'null' to NULL and now I don't see this errors. |
Also I've checked new queries after 'null'->NULL update and didn't see 'null'. |
Issue Summary
Query schedule doesn't work if there "until" field equals None:
Schedule from queries table:
{"interval": 300, "until": null, "day_of_week": null, "time": null}
It can't parse null value.
Is it ok to remove "until" field if it equals null ?
Technical details:
The text was updated successfully, but these errors were encountered: