-
Notifications
You must be signed in to change notification settings - Fork 5
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
Granular Key Assertions #106
Conversation
Code Coverage Summary
Results for commit: 1acb505 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
Unit Tests Summary 1 files 13 suites 6s ⏱️ Results for commit 1acb505. ♻️ This comment has been updated with latest results. |
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.
I am wondering if we are changing this if we might also tell the user what the two different modes/classes are?
I think it would be much cleaner to have something like
"Error, key1 is numeric in BASE and character in COMPARE" rather than mentioning modes at all, which the user might not understand.
Similarly
"Error, key1 has class 'A' in BASE and class 'B' in COMPARE"
I'm not sure... like I get the appeal of this but in practice it's kinda messy. If there are several variables with mismatches or if its a variable with lots of classes it is likely difficult to print this in a nice way; ideally you'd probs then want to print a table but this then just feels like overkill. My gut feeling is what we have here is more than enough to inform the user on what to look into to fix the error. |
Github doesn't have threaded replies :( I think my main issue with the error message as it is is that mode may not mean anything to the user right now. Maybe even an explanation "A and B have different modes (different types of data, e.g. numeric and character)" or maybe even just say they have different classes, as that will also be true I think, and classes is better understood, and we error if they dont match on class anyway? |
@kieranjmartin - Can you remember why we ended up using EDIT --- Useful breakdown of where they differ to each other link some other commenters there seem to be inferring that typeof and class are the most important and that mode is pretty much value-less Overall I'm not sure how I want to proceed with this, I really don't want to say "different types" or "different classes" if we are comparing modes because yes whilst many users won't know the difference that doesn't change the fact that it would be wrong / misleading. Potentially we could just add a "(see ?mode)" to point users in the right direction ? |
Yes maybe this is the best course forwards actually, just so they have some guidance as to what it means, as I don't think mode is a commonly used term (and honestly I would have to look it up to remember exactly what it means). I do not recall why we did not use type; I think mode is perhaps more pedantic than type, and we wanted to be that pedantic.? Although that list seems to say not |
Yer I just ran diffdf tests using type instead of mode and a load of the factor comparison code falls over. I think this is because factors store as ints that have type "integer" whilst reals have type "double" they both have a mode of "number" that is to say mode appears to be more fussy than type. I'm guessing at the time we thought this level of comparison doesn't matter though I feel inclined to disagree now (especially given that we have "strict_factor" to opt in and out of such pedantic comparisons which can be used to mask this). I think I would propose switching to typeof instead though perhaps for v2 as its likely to introduce some backwards compatible breaks |
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.
Approved, but maybe add (see ?mode) to the error message
Closes #76