-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: to_csv with chunksize mismatched formatting of dt64 #55481
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
@jbrockmendel Hi, I think your PR introduced this problem. Would you like to submit a new PR to fix it or me? |
Go for it. |
take |
After investigating it carefully, I found it is not easy to fix. While it's tough to infer the format by looking at the entire array.
I used to consider removing the special case, but the code has existed for over 10 years so it probably breaks the compatibility. Could you provide me with more information about your original expectations? |
Best guess is that to address this we would need to find the appropriate format by looking at the entire column(s) in/before _save_body, then pass that to _save_chunk. This is probably not a Good First Issue unless you really need this to be fixed in the short term. |
In io.formats.csvs we call _save_body which iterates over chunks calling _save_chunk, which determines the format to use chunk-by-chunk. But for dt64 values (also td64) we determine the format to use (in most rendering contexts) by looking at the entire array.
Note this doesn't actually require chunksize to be specified to get the bad behavior, just to get a concise example.
Expected Behavior
The text was updated successfully, but these errors were encountered: