-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
pow() does not throw error for extra or incorrect arguments like quotient() does #3062
Comments
I did something for it. @thadguidry please check. |
What do you intend to compute with |
@wetneb Oh you are absolutely right! Hmm, we should give warnings then. Perhaps I should change this issue title and comment? Or close this and open a new one might be best. |
Hi @thadguidry |
Yes, it's an error, but I think the point of the original bug report was that the error handling for the two cases should be equivalent. They should either both return error or both return null. I have a strong preference for the former. This isn't limited to OpenRefine/main/tests/server/src/com/google/refine/grel/FunctionTests.java Lines 133 to 137 in c8a721a
|
Would we then have to modify every single one of these? |
Yes @elroykanye. It's the same pattern to use to check. Regards, |
Alright then, I will go through each and enforce the pattern of returning an EvalError if there are no objections. |
OpenRefine/main/tests/server/src/com/google/refine/grel/FunctionTests.java Lines 132 to 134 in c8a721a
I am really concerned with the comment at L131. Will changing the returns of these affect the tests that have already been prepared? |
@elroykanye : yes, you will have to adapt some test cases, write new ones, and be careful… ;-) Regards, Antoine |
Okay, thanks 😁 |
@elebitzero: there seams to be a misunderstanding here. @elroykanye was assigned the issue, and I see that you submitted a Pull Request. Before creating a PR, please make sure no one is already assigned. In the OpenRefine community, we value your time and efforts, and if 2 persons works on the same issue at the same time, we fear it could be an inappropriate use of your time, making one of you two working for nothing. That being said, I appreciate your involments — both of you — thanks you for your contributions. Regards, Antoine |
Thanks @antoine2711 . |
@antoine2711 @elroykanye, oops, I'm just seeing these recent comments now. It looks like I picked up this issue at the same time @elroykanye started looking into it. I should have commented on the issue first. I fixed the issue where I also added a new test Note: @thadguidry mentioned |
@elroykanye, my PR removes "exp" and "pow" from the returnsNull set in the testTooManyArgs test. They now return error for incorrect number of arguments. The other functions are string functions; I would create a separate issue for those. |
Actually, @elebitzero, the key here is the person « Assigned » to the issue. The first who put his name there is the one in charge, so to say. Anyway, since you and @elroykanye are at a good profeciency level, I guess you will be able to work together on this issue. ;-) Regards, Antoine |
@elebitzero we can definitely work together so this can be resolved 😃😁 |
To Reproduce
Steps to reproduce the behavior:
value.pow(2,8)
null
value.quotient(2,8)
Error: quotient expects two numbers
Current Results
null
is shown in preview result, instead of an error (sincevalue
is passed as one of the arguments with additional 2 arguments(2,8)
supplied)Expected Behavior
pow()
should check arguments likequotient()
does and show similar error.Screenshots
Versions
Datasets
Additional context
The text was updated successfully, but these errors were encountered: