fix: Use Celery task ETA for alert/report schedule #24537
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SUMMARY
After installing Superset with Celery to 5.3.0 (within the defined constraints) we started to notice an issue with Superset trying to parse a date/time string which was already of type
datetime
.I've spent a good amount of time perusing the Celery changelog and couldn't find anything which would have caused the regression, given that it seems we're using JSON for serialization/deserialization and there was no mention of the decoder trying to decode temporal arguments.
I did notice that there was some "magical" handling for the request ETA which, per here, tries to coerce the JSON encoded date/time into a
datetime
object. Digging a little future there seems to be some redundancy in how we define our tasks, i.e., providing both an ETA and a schedule which equate to the same thing.This PR circumvents the problem by simply removing specifying the schedule in addition to the ETA which removes redundancy the need to decode the schedule. Note an alternative would be to tighten the constraint on the upper bound of feasible Celery versions, but this approach seemed more accomodating.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
CI.
ADDITIONAL INFORMATION