-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Retain return type from @dispatcher.span #17817
Conversation
OK, I believe the type checking is working better now. However, this has uncovered typing issues in 11 other files. 🤔 |
Some of these might be actual bugs. For example, llama_index/llama-index-core/llama_index/core/query_engine/retry_source_query_engine.py Lines 42 to 48 in f43e337
llama_index/llama-index-core/llama_index/core/base/response/schema.py Lines 234 to 236 in f43e337
|
Note, commit 9303917 is a pretty good branching point before I went down a deep rabbit hole. (8 mypy errors remaining there) |
d54996e gets back to 7 mypy errors (better than before the rabbit hole) |
For these remaining mypy errors, I'm not sure I know the code well enough to determine whether it's best to "fix" the types, squelch the error (with a cast or type ignore), or if there are potential bugs in the code.
https://github.com/run-llama/llama_index/actions/runs/13335762370/job/37250483650?pr=17817 |
1a743c0
to
4e9d83a
Compare
Reworked commits to be a little more cohesive. |
Fixed the remaining type checking issues. The |
The |
b7a30e3
to
6055ff1
Compare
Copied pattern from: llama-index-core/llama_index/core/query_engine/retry_query_engine.py
Looks safe based on the structure of the existing code.
Also sets docling-core minimum version to 2.18.0 for deterministic test results. https://github.com/DS4SD/docling/blob/e1436a8b0574e6bb2bb89bd65e98221e418d7142/CHANGELOG.md#v2210---2025-02-10
6055ff1
to
ef742d3
Compare
|
I'm not sure why your type checking uncovered so many errors. Our CICD runs type checking on core in every PR, and these haven't been issues.
Actually no. More-so a symptom of lazy typing lol. a synchronous query will never return an async response I appreciate the type fixes, but since they weren't an issue in CICD before, I'd feel better about this change if we just split out the actual changes to the dispatcher 🤔 Lots of changes flying around at the moment |
The With some additional effort, it should be possible to shrink the changes in 742c866 if necessary. There were a few typing issues uncovered by the The unit test issue was an artifact of the build system choosing a newer version of docling. It should be possible to fix that in a separate PR, as long as that PR is merged before this one. |
In fact, your PR #17831 is hitting the same unit test failure I fixed here. |
Yea I've been ignoring that docling test (the test itself is a little silly lol) Ok fair, that makes sense if the dispatcher was swallowing types. Let me take a deeper look at these changes to make sure there isn't a breaking change... |
Attempt to fix #16915
Version Bump?
Did I bump the version in the
pyproject.toml
file of the package I am updating? (Except for thellama-index-core
package)Type of Change
Please delete options that are not relevant.
How Has This Been Tested?
Your pull-request will likely not be merged unless it is covered by some form of impactful unit testing.
Suggested Checklist:
make format; make lint
to appease the lint gods