-
Notifications
You must be signed in to change notification settings - Fork 880
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
give name of function inside incorrect parameters error #538
Conversation
tests/pipeline/test_node.py
Outdated
@@ -337,15 +337,15 @@ def dummy_func_args(**kwargs): | |||
[ | |||
( | |||
inconsistent_input_size, | |||
r"Inputs of function expected \[\'input1\'\], but got \[\'A\', \'B\'\]", | |||
r"Inputs of function 'identity' expected \[\'input1\'\], but got \[\'A\', \'B\'\]", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks nicer. Can we add some tests for lambda
and partial
when they are passed as the callable to the node
? Not sure if it'll be as pretty.
All python objects should be able to resolve repr so this will be a bit more rubust against all types of callables.
@lorenabalan any ideas how to get tests passing? For some reason |
This reverts commit 58636d9.
Actually looking at the test cases, I would argue the error message looks more complicated now - addresses in memory are not that user-friendly. Could we instead factor out and leverage the same logic we have in |
I am not sure that my change should be causing a seg fault in the memory profiler tests??? Could you rerun tests and see if it persists? I think I got it cleaned up, and it looks much better, than for the |
Thanks for re-running! Tests are passing. @lorenabalan how does the updated format look? I like that it matches up with other kedro function naming methods. Personally I am not sure that I like that there are more than one place figuring out how to name a function, but that would have started touching more things than I preferred to do from my end without first discussing. |
The format looks good to me - maybe could be
Yeah I agree - looking through the code base, I also found this variation of the implementation. 😅 The decorators are going to be deprecated in 0.17.0 so I'm not that worried about that one, it just illustrates that we don't have a consistent way to handle it. Could we factor out the logic from |
Description
This is a quick and simple step towards the right direction to resolve #495.
Development notes
I ran
kedro new
, and broke one of the nodes. There is a comparison of the current error and the updated error below. This error is also inspected by the test framework.Current Error
Does not give much information to what node caused the TypeError. While this is generally easy to figure out on small pipelines, larger pipelines can be quite intense to figure out where the error came from. Any additional information would be greatly appreciated.
Updated Error
The updated error will give the name of the function for full functions, but does not provide better messaging for lambdas.
Feedback
func.__code__.co_name
method?Checklist
RELEASE.md
fileNOTE No new tests were created, only modification of existing tests.
Notice
I acknowledge and agree that, by checking this box and clicking "Submit Pull Request":
I submit this contribution under the Apache 2.0 license and represent that I am entitled to do so on behalf of myself, my employer, or relevant third parties, as applicable.
I certify that (a) this contribution is my original creation and / or (b) to the extent it is not my original creation, I am authorised to submit this contribution on behalf of the original creator(s) or their licensees.
I certify that the use of this contribution as authorised by the Apache 2.0 license does not violate the intellectual property rights of anyone else.