-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: HDFStore.append with encoded string itemsize #11240
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
3adc74e
to
c5b9a60
Compare
So initially I had to call
All the tests passed, but I've never worked with numpy's fixed length strings. Hopefully I'm not breaking any rules here. |
@@ -42,3 +42,10 @@ Performance Improvements | |||
|
|||
Bug Fixes | |||
~~~~~~~~~ | |||
|
|||
|
|||
- Bug in HDFStore.append with strings whose encoded length exceded the max unencoded length (:issue:`11234`) |
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.
use double backticks around HDFStore.append
c5b9a60
to
e9b2d27
Compare
|
||
def convert_string_data(self, data, itemsize, encoding): | ||
return _convert_string_array(data, encoding, itemsize) | ||
self.set_data(data_converted.astype('|S%d' % itemsize)) |
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.
right that is ok (though maybe pass copy=False
) (e.g. if we didn't change it don't want to copy again)
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.
Didn't know that was a kwarg to astype
, cool.
I'll ping you when it's green.
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.
yep.....these 0.17.1 will have to wait till after I release 0.17.0 (on friday).....but getting them lined up
Failure came when the maximum length of the unencoded string was smaller than the maximum encoded lenght.
e9b2d27
to
59eee79
Compare
merged via 26db172 thanks @TomAugspurger |
Closes #11234
Failure came when the maximum length of the unencoded string
was smaller than the maximum encoded length.
Need to run a perf check still. We end up having to call
_convert_string_array
twice, once before we know the min_itemsize, and a second time just before appending once we do know the min itemsize.