-
Notifications
You must be signed in to change notification settings - Fork 943
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
KeyError: 'label' error message could be more clear #25
Comments
Great suggestion. We might need a broader overhaul of logging and exception handling. What do you think @amit-sharma ? |
Is this error caused when calling the 'CausalModel()' when it internally creates the graph through the 'CausalGraph()' API or somewhere else? because I am not able to reproduce the error locally. |
I think this error is raised when you input your own graph as a string and forget to add all required nodes. So if you provide a dot graph with missing nodes, and then call CausalModel with that graph, it should throw this error. |
Hi! I'm unsure if it persists since I'm not currently using the library. But the point was that the error message didn't help as much as it could in identifying what the missing nodes were. |
Hey @amit-sharma! I would like to help out in fixing this bug. Can you let me know what kind of error message do you expect? |
thanks for contributing, @rahulbshrestha It will be nice to output an error message that describes the source of the bug. Something like, "Some nodes are missing in the graph: {node1name, node2name} " |
I can't seem to reproduce this issue, how can I provide a dot graph with missing nodes such that the KeyError appears? Experimenting with this:
where, df consists of X,Y and Z as columns. I'm not sure if @lgmoneda meant in this case
where an |
Try this. Does the following code raise the error? model=CausalModel( |
Thanks for checking @rahulbshrestha Looks like this issue is resolved in the current version. We can close this issue. |
When you miss declaring a node in your causal graph, it's going to throw a
KeyError: 'label'
error. It could be more explicit to make debugging easier. I think it would be nice to inform what is the node hough used in the graph.The text was updated successfully, but these errors were encountered: