Repository navigation
fix(Install): Name the extras when a plain install tries to fetch data - #45
Merged
Merged
Conversation
A plain `pip install aperiodic` has no HTTP client, so data calls fell to the Pyodide transport and crashed with "No module named 'pyodide'". Outside Pyodide that transport now raises an ImportError naming the extras (aperiodic[polars] or aperiodic[pandas]), the Pyodide check returns False instead of raising, and the README installs an extra first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MoDcuvZ8WqH4mnxq31Muur
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The bug
A plain
pip install aperiodic(the README's first instruction) installs no HTTP client. The first data call then falls to the Pyodide transport and crashes:This turned up while testing the 4.4.0 release.
aperiodic.login()works on a plain install, since it only uses the standard library, so the very next call is where people hit it. The bug itself is older than #43.The fix
ImportErrorthat names the fix:pip install "aperiodic[polars]"orpip install "aperiodic[pandas]". This happens inrun_async,fetch_jsonanddownload_parquet_bytes, andrun_asynccloses the coroutine first, so there's no "never awaited" warning._has_pyodide_ffi()returnsFalseinstead of raising when there's nopyodidepackage at all.pip install "aperiodic[polars]" # or "aperiodic[pandas]", and says a plain install is enough to sign in but not to fetch data.sys.modules, nothing changes.Checks
TestPlainInstalltests cover detection returningFalse, sync calls naming the extra and closing the coroutine, and async calls naming the extra. All three fail onmainand pass here.get_symbols(...), now ends with theImportErrorabove instead of the pyodide crash.main(they need a real key and network); 199 pass.Generated by Claude Code