-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: FloatingArray(float16data) #44715
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
Conversation
pandas/tests/frame/methods/test_shift.py::TestDataFrameShift::test_shift_dt64values_axis1_invalid_fill[Float32-True] -- Docs: https://docs.pytest.org/en/stable/warnings.html looks like an xpass |
i guess user facing if you can add a note |
has one |
Yah I've seen that locally too, haven't found a good way to suppress it. |
Opened numpy/numpy#20512 about the xpass |
greenish |
This PR has broken the tests for me as a non-US user. The new test here adds a |
What locale are you using? Let’s update the condition to be more specific |
My locale is
that is the locale is However, I believe this is going to be a rabbit hole: There will always be a locale that hasn't been considered causing trouble for somebody else - that is exactly what happened in #44625. Either an API is locale-dependent, or it isn't. If it is, we shouldn't try to make any assumptions about the value unless we know exactly what the locale is. Either the locale should be set within the context of the test (difficult, because there is no API for a context-local locale change), or any outcome should be accepted unless the current locale happens to match a specific known one. In the case here, any unknown locale should be directed to |
Not sure where this cases fits in this dichotomy: numpy's behavior clearly shouldn't depend on the locale, but in practice does.
I've been making a push to change skips to xfails because many of the skipped tests get fixed without us being alerted to that fact. I recognize this is a pain point for you, but I think the solution here is to figure out the actually-correct condition under which numpy gives the weird behavior and only xfail in that case.
pd._config.localization.set_locale? |
You are right of course, there is a third option: An API that is not documented can do anything it wants. The common cases here is of course the exception path: Take any documented API and use it in an unsupported way - in python we expect to get an Exception, but there is no specification how that exception looks like. The thing is, both here and in #44625 we acknowledge that the exception message is in fact locale-dependent, as we modify the test behaviour based on the current locale.
If you want to mark a test-case to fail due to an upstream bug that is out of control I don't know about you, but I have no clue how I would be able to predict the behaviour for every possible locale. Unless you can find a reasonably efficient way to identify the behaviour of a locale-dependent API for every conceivable locale (and the CI tests cover every such locale), I stand by my assessment: We should not make any assumptions about unknown locales. IMHO, the best fix for both issues (that is the test this PR broke, as well as #44625) is to only check the specific exception message when the locale is among a small restricted set of known locales (such as en_US only), and for every other locale just check the exception type. I'm willing to create a PR to that end. The other option would be to force the locale within those tests, but changing the locale (even temporarily) is often frowned upon...:
Didn't know that one, thanks for the pointer! It appears to be a context manager that uses |
The process is an iterative one. We'll fix the test in your locale, then wait for someone else to inform us the test is broken in their locale and recurse. I recognize that is an annoyance, but the alternative of skipping would mean that functionality would be untested in e.g. your locale.
Good to know, thanks! |
It's a compromise between false negatives and false positives. I would have assumed that false negatives are rare - it's hard to break something just for single individual locales if there is no public locale-dependent API/functionality at all. False positives however will make it difficult for non-regular contributors like me to contribute - if unrelated tests fail, we usually don't know if the test is broken or the code is broken. I realise however that I might really be misunderstanding the issue that is being tested in the particular test here. So we should really deal with each issue separately. I have thus opened #45013. |
FWIW i see local failures too.
|
I don't have the bandwidth to continue with this. Please make a PR. |
Broken off from #43930 then fleshed out with targeted tests.