Engine crashes when client sends nan or inf float to UI
I maintainer di solito rispondono entro 2 giorni
@Exudev ci sta già lavorando.
Dal 24/2/2026.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 65/100
Direzione di ricerca
Inizia in tracking/utils, in make_json_safe, e ispeziona il controllo di json.dumps descritto nell’issue. Riproduci il problema facendo restituire nan e inf al node mentre il tracking è abilitato, quindi verifica che la UI riceva questi valori come null senza che l’engine o il request worker si blocchi.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The requests JSON serializer defaults to not handling nan or inf floats and instead throws an exception that crashes the engine. The tracking/utils:make_json_safe function does not make objects safe enough to avoid this and doesn't detect it since the json.dumps check doesults to allowing nans.
Current behavior
Engine crashes if a node returns nan or inf floats.
Stack Traces
Traceback (most recent call last):
File "/opt/homebrew/Cellar/[email protected]/3.13.11_1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/threading.py", line 1044, in _bootstrap_inner
self.run()
~~~~~~~~^^
File "/opt/homebrew/Cellar/[email protected]/3.13.11_1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/threading.py", line 995, in run
self._target(*self._args, **self._kwargs)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/mfornander/gitlab/dcsim/.venv/lib/python3.13/site-packages/hamilton_sdk/api/clients.py", line 236, in worker
self.flush(batch)
~~~~~~~~~~^^^^^^^
File "/Users/mfornander/gitlab/dcsim/.venv/lib/python3.13/site-packages/hamilton_sdk/api/clients.py", line 262, in flush
response = requests.put(
f"{self.base_url}/dag_runs_bulk?dag_run_id={dag_run_id}",
...<5 lines>...
verify=self.verify,
)
File "/Users/mfornander/gitlab/dcsim/.venv/lib/python3.13/site-packages/requests/api.py", line 130, in put
return request("put", url, data=data, **kwargs)
File "/Users/mfornander/gitlab/dcsim/.venv/lib/python3.13/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/mfornander/gitlab/dcsim/.venv/lib/python3.13/site-packages/requests/sessions.py", line 575, in request
prep = self.prepare_request(req)
File "/Users/mfornander/gitlab/dcsim/.venv/lib/python3.13/site-packages/requests/sessions.py", line 484, in prepare_request
p.prepare(
~~~~~~~~~^
method=request.method.upper(),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<10 lines>...
hooks=merge_hooks(request.hooks, self.hooks),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/Users/mfornander/gitlab/dcsim/.venv/lib/python3.13/site-packages/requests/models.py", line 370, in prepare
self.prepare_body(data, files, json)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
File "/Users/mfornander/gitlab/dcsim/.venv/lib/python3.13/site-packages/requests/models.py", line 512, in prepare_body
raise InvalidJSONError(ve, request=self)
requests.exceptions.InvalidJSONError: Out of range float values are not JSON compliant
Screenshots
n/a
Steps to replicate behavior
Add this simple node, enable on tracking on a working UI server, and ask for the node's result.
def nan_inf() -> list[float]:
return [1.0, float("nan"), float("inf")]
Library & System Information
Python 3.13
Hamilton 1.89
Expected behavior
Not crashing and showing nan and inf values as "null" in UI.
Additional context
I have a simple fix for your make_json_safe function. Let me know if you want a PR.
- Lingua principale
- Jupyter Notebook
- Stelle
- 2.6k
- Fork
- 221
- Merge medio
- 2g 1m
- PR unite (30g)
- 17
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/hamilton
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 2 giorni
-
More detailed type annotations in graph visualizationsForse di nuovo libera @Nishant-Manocha l’ha presa 369 giorni fa e non c’è nessuna pull request aperta. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
apache/hamilton#1383 · 4 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
Documentation: add explainer for FastAPIForse di nuovo libera @Aditya-Deshwal23 l’ha presa 188 giorni fa e non c’è nessuna pull request aperta. Apertadocumentation
Difficoltà 2/5 1-2 giorni Idoneità per principianti 65/100
apache/hamilton#1304 · 5 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
Link back to github from reference API docsForse già presa @naikvaib l’ha presa 26 giorni fa. Apertadocumentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
apache/hamilton#572 · 3 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
display_name tag is ignored in visualizations for @config.when nodesForse già presa @digit50 l’ha presa 1 giorno fa. Aperta
Difficoltà 3/5 Mezza giornata Idoneità per principianti 72/100
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di apache/hamilton
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
run_all sleeps after the final job despite documenting delays between jobsForse già presa @Gambit-Checkmate l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
bnv-manager-v2: accept_invite creates the Mailcow domain admin before the commitForse già presa @myOmikron l’ha presa oggi. Apertabug ready-for-agent
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
BUG
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
Mai-with-u/MaiBot#2187 ·
I maintainer di solito rispondono entro 1 giorno
-
AG-UI bug pkg:core
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
pydantic/pydantic-ai#10538 ·
I maintainer di solito rispondono entro 1 giorno