-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
UnboundLocalError in _concat_single_item() #3833
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
Comments
though I fixed this....just need to move the first statement outside of the try: except: PR? |
yes, thanks; just wanted to report. sorry didn't find any previous report. |
oh....it still looks like an error, what I meant was do you want to submit a PR to fix? |
@stefan-pmc do you have a case that reproduces this? |
@stefan-pmc if u provide the case i will fix :) |
unless u want to submit a PR that is great too! |
hard to supply the actual data but basically the error will happen for example if you try to do pd.concat() on a bunch of dataframes where one of them has an index with duplicates in it. if you move the first line outside the try block then it will generate the correct error message (cannot reindex with non unique index values), so that should do the job. |
oh sorry :) a PR == pull request...do u need additional details about pull requests? happy to oblige! |
yes please explain – though it sounds like a very weighty approach for such a small bug. |
no...the reason for the PR is that you can test locally, make sure everything passes, then travis tests it (the continuous integration service) to make sure it is passing on many different configurations seemingly trivial issues can cause issues later if they break things (or worse, DONT break things which we don't have a test for) |
I always assume the worst with unbound local errors since there are subtle issues surrounding scope, binding, and exceptions in Python across versions. |
yes, that makes sense, though in this case I think it is simply that it creates the variable rdata inside the try block and then uses it in the exception handler part; what happened is that an exception is generated before the variable is created. taking the first line out of the try block solves that problem. not sure if that itself creates problems elsewhere of course. |
try running |
@stefan-pmc they may be exactly the case, the problem is changing it without having a test case is not good because the next change may break this one :) |
thanks......I cannot reproduce the error unless I actually have a code-error in the prepare_blocks itself....so just fixing the code |
The exception handling code in _get_concatenated_data() relies on the exception not being generated in self._prepare_blocks() and can generate an exception with this non-informative error message:
The text was updated successfully, but these errors were encountered: