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

Closed
wants to merge 1 commit into 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

Copy link

github-actions bot commented Aug 1, 2024

This pull request is marked as stale as it has had no activity in the past 3 months. Please respond to this comment if you're still interested in working on this. Many thanks!

@github-actions github-actions bot added the stale Marker label for stale issues. label Aug 1, 2024
@github-actions github-actions bot added the abandoned - stale PRs automatically closed due to stale status label Aug 9, 2024
@github-actions github-actions bot closed this Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 - In Progress abandoned - stale PRs automatically closed due to stale status stale Marker label for stale issues.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants