-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Raise exception on non-unique column index in to_hdf for fixed format. #7788
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
hmm, maybe make this a |
Well, with the current fixed format it is in fact invalid. There is no way to get this right without changing |
it could be implemented (it just isn't). You are preventing the writing (which invalidates the reading) either way. The exception will be more informative ( Actually you might want to have a nice exception message saying that you CAN store this in 'table' format. |
@@ -2680,6 +2680,9 @@ def write(self, obj, **kwargs): | |||
|
|||
self.attrs.ndim = data.ndim | |||
for i, ax in enumerate(data.axes): | |||
if i == 0: | |||
if not ax.is_unique: | |||
raise ValueError("Columns index has to be unique for fixed format") |
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.
say, you can store this in table format, however.
It could not be implemented because If this is the only thing keeping you from merging I'll change it to |
Raise exception on non-unique column index in to_hdf for fixed format.
@filmor thanks for this! |
this is technically for a non-unique info_axis (e.g. columns for df, but 0 axis for Series/Panel). Can you add some tests for this? And update the note in v0.15.0 (I moved it a bit) |
Fixes #7761.