The Fix
Updated the solar function documentation to indicate that it accepts both floats and integers for latitude and longitude.
Based on closed celery/celery issue #7875 · PR/commit linked
Production note: This usually shows up under retries/timeouts. Treat it as a side-effect risk until you can verify behavior with a canary + real traffic.
@@ -1,14 +1,17 @@
@@ -1,14 +1,17 @@
"""Schedules define the intervals at which periodic tasks run."""
+from __future__ import annotations
-import numbers
from celery.schedules import solar
app.conf.beat_schedule = {
# Executes at sunset in Melbourne
'add-at-melbourne-sunset': {
'task': 'tasks.add',
'schedule': solar('sunset', -37.81753, 144.96715),
'args': (16, 16),
},
}
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Option A — Apply the official fix\nUpdated the solar function documentation to indicate that it accepts both floats and integers for latitude and longitude.\nWhen NOT to use: This fix is not applicable if the documentation is already correct.\n\n
Why This Fix Works in Production
- Trigger: - [x] I have included all related issues and possible duplicate issues in this issue
- Mechanism: The documentation for the solar function incorrectly specifies latitude and longitude as integers instead of floats
- If left unfixed, retries/timeouts can trigger duplicate external side-effects (double charges, duplicate emails, repeated writes).
Why This Breaks in Prod
- The documentation for the solar function incorrectly specifies latitude and longitude as integers instead of floats
- Production symptom (often without a traceback): - [x] I have included all related issues and possible duplicate issues in this issue
Proof / Evidence
- GitHub issue: #7875
- Fix PR: https://github.com/celery/celery/pull/8114
- Reproduced locally: No (not executed)
- Last verified: 2026-02-11
- Confidence: 0.70
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.71
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“Hey @Kaju-Bubanja :wave:, Thank you for opening an issue”
“can you share any testcase/example? and what warnings you are facing?”
“Fixing this in https://github.com/celery/celery/pull/8114.”
Failure Signature (Search String)
- - [x] I have included all related issues and possible duplicate issues in this issue
- or possible duplicates to this issue as requested by the checklist above.
Copy-friendly signature
Failure Signature
-----------------
- [x] I have included all related issues and possible duplicate issues in this issue
or possible duplicates to this issue as requested by the checklist above.
Error Message
Signature-only (no traceback captured)
Error Message
-------------
- [x] I have included all related issues and possible duplicate issues in this issue
or possible duplicates to this issue as requested by the checklist above.
Minimal Reproduction
from celery.schedules import solar
app.conf.beat_schedule = {
# Executes at sunset in Melbourne
'add-at-melbourne-sunset': {
'task': 'tasks.add',
'schedule': solar('sunset', -37.81753, 144.96715),
'args': (16, 16),
},
}
What Broke
Linters trigger warnings due to incorrect type specifications in the documentation.
Why It Broke
The documentation for the solar function incorrectly specifies latitude and longitude as integers instead of floats
Fix Options (Details)
Option A — Apply the official fix
Updated the solar function documentation to indicate that it accepts both floats and integers for latitude and longitude.
Option D — Guard side-effects with OnceOnly Guardrail for side-effects
Mitigate duplicate external side-effects under retries/timeouts/agent loops by gating the operation before calling external systems.
- Place OnceOnly between your code/agent and real side-effects (Stripe, emails, CRM, APIs).
- Use a stable key per side-effect (e.g., customer_id + action + idempotency_key).
- Fail-safe: configure fail-open vs fail-closed based on blast radius and spend risk.
- This is most useful when retries/timeouts can re-trigger the same external call.
Show example snippet (optional)
from onceonly import OnceOnly
import os
once = OnceOnly(api_key=os.environ["ONCEONLY_API_KEY"], fail_open=True)
# Stable idempotency key per real side-effect.
# Use a request id / job id / webhook delivery id / Stripe event id, etc.
event_id = "evt_..." # replace
key = f"stripe:webhook:{event_id}"
res = once.check_lock(key=key, ttl=3600)
if res.duplicate:
return {"status": "already_processed"}
# Safe to execute the side-effect exactly once.
handle_event(event_id)
Fix reference: https://github.com/celery/celery/pull/8114
Last verified: 2026-02-11. Validate in your environment.
When NOT to Use This Fix
- This fix is not applicable if the documentation is already correct.
- Do not use this to hide logic bugs or data corruption. Use it to block duplicate external side-effects and enforce tool permissions/spend caps.
Verify Fix
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Did This Fix Work in Your Case?
Quick signal helps us prioritize which fixes to verify and improve.
Prevention
- Capture the exact failing error string in logs and tests so you can reproduce via a minimal script.
- Pin production dependencies and upgrade only with a reproducible test that hits the failing path.
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.