Skip to content
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

[WIP] Improve typed dict KeyError traceback #9530

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Arenhart
Copy link

@Arenhart Arenhart commented Apr 16, 2024

While coding a parallel implementation with Numba that used typed dict, I had a lot of trouble debugging because the KeyError exception did not return any information. I made a small change in the dictobject.py to return the key value and type on the traceback, and it helped a lot. This commit includes this modification.
However, it would have been better if the traceback pointed to the actual python line where the KeyError occurred, though I don't know if this is possible, or how to do it. I'm creating this PR as WIP in hope I can get some insight on this viability.

@esc
Copy link
Member

esc commented Apr 26, 2024

@Arenhart this modification looks good. While I don't know if the source line could be printed alongside the error, I would recommend trying to get this change merged. To do so, it would need some tests however to make sure that the error message does match what is intended.

@Arenhart
Copy link
Author

Arenhart commented May 1, 2024

I'm having a lot trouble trying to implement the tests. When I try to run the Numba tests, a get a llvmlite version error

ImportError: Numba requires at least version 0.43.0 of llvmlite.
Installed version is 0.42.0.

I did not find version 0.43 in conda, and when I tried to compile llvmlite 0.43, I failed because the windows distribution of LLVM doesn't have the llvm-config file.

Is there some solution besides compiling LLVM? Otherwise I think I'll wait until llvmlite 0.43 gets uploaded to conda.

@esc
Copy link
Member

esc commented May 2, 2024

I'm having a lot trouble trying to implement the tests. When I try to run the Numba tests, a get a llvmlite version error

ImportError: Numba requires at least version 0.43.0 of llvmlite. Installed version is 0.42.0.

I did not find version 0.43 in conda, and when I tried to compile llvmlite 0.43, I failed because the windows distribution of LLVM doesn't have the llvm-config file.

Is there some solution besides compiling LLVM? Otherwise I think I'll wait until llvmlite 0.43 gets uploaded to conda.

During development, you can fetch the dev package for llvmlite using:

$ conda install -c numba/label/dev llvmlite

it should always get you an llvmlite that will allow the Numba checkout of main to compile. I also maintain a repo with some personal tooling for Numba including a makefile, if you need to look at the commands used to build and run tests and so on:

https://github.com/esc/numba-dev-files/blob/master/Makefile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants