Skip to content

Conversation

Wauplin
Copy link
Contributor

@Wauplin Wauplin commented Sep 12, 2025

Currently if an object has a circular reference (e.g. a dictionary with an entry referencing the dictionary itself), we are using the RecursionError to determine that the object is not "jsonable". This is far from been optimized. This PR updates the logic to return early as soon as a circular reference is detected.

Code in this PR has been generated using VS Code + Inference Provider + gpt-oss-120b 😃

This PR should fix transient issues we have in the Windows CI:

...
[gw11] win32 -- Python 3.9.13 D:\a\huggingface_hub\huggingface_hub\.venv\Scripts\python.exe
worker 'gw11' crashed while running 'tests/test_utils_typing.py::test_is_jsonable_failure[data4]'
...
=========================== short test summary info ===========================
FAILED ..\tests\test_utils_typing.py::test_is_jsonable_failure[data4]
= 1 failed, 1304 passed, 222 skipped, 14 xfailed, 145 warnings, 8 rerun in 297.29s (0:04:57) =

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Contributor

@hanouticelina hanouticelina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good! 👍

@Wauplin Wauplin merged commit 92351f3 into main Sep 12, 2025
26 checks passed
@Wauplin Wauplin deleted the fix-ci-avoid-recursion-error branch September 12, 2025 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants