Closed allComputableThings closed 5 years ago
virtually no pandas functions are threadsafe, becuase .copy() is not, see https://github.com/pandas-dev/pandas/issues/2728
Not very satisfactory - especially for non-mutating operations.
Since the bug you referenced is still open, could we keep this one open.
Since the bug you referenced is still open, could we keep this one open.
so we will have 1 more issue, what's the purpose? this is a duplicate issue
its not entirely obvious it is the same bug. In the bug you referenced, the issue is that .copy is not safe because some-one might be writing to the data at the copy (which I would not have assumed to be thread safe). In my bug, no-one is writing to the data, its still not safe. I would have assumed that operations returning new objects, and not obviously changing the original to be safe unless otherwise noted -- they're not. Is .copy the cause? Maybe. I don't see why though.
when a bug is closed, the failure cases should be unit tests to prevent regression.
your are welcome to submit a PR if you want to provide a test
this is a duplicate of an unfixed issue
we have 2900 issue - would welcome help doing things here - sure reporting bugs is great but pandas is all volunteer for anything else
Would love, too.
If I had any idea why reading from an object that no-one is writing to would not be safe, I'd think about fixing it.
Code Sample, a copy-pastable example if possible
Problem description
pd.Series.reindex fails in a multi-threaded application.
This is a little surprising since I'm not asking for any writes.
The error also seems bogus: 'cannot reindex from a duplicate axis' ... the series does not have any duplicate axis and I was able to call
s.reindex(idx)
in the main thread before the same failed in the pool's thread.Expected Output
Program should output nothing.
Output of
pd.show_versions()