-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Better error message for CSV writer in the presence of comments #7801
Conversation
Hi there @pllim 👋 - thanks for the pull request! I'm just a friendly 🤖 that checks for issues related to the changelog and making sure that this pull request is milestoned and labeled correctly. This is mainly intended for the maintainers, so if you are not a maintainer you can ignore this, and a maintainer will let you know if any action is required on your part 😃. I noticed the following issue with this pull request:
Would it be possible to fix this? Thanks! If there are any issues with this message, please report them here. |
I feel 3.1 is about right, otherwise it would be a small API change for LTS (raising ValueError rather than the current messy TypeError). |
@pllim - Thanks! Trying out the examples given in #7357 with this branch:
That's another cryptic TypeError. Related or a new issue? In this case following the suggestion to put
|
I think a better behavior would be to simply drop the comments with a warning that they can be saved with the suggested workaround. That is, I think it should just work by default and not output comments, and users can opt in to include comments. I don't think it should crash by default. |
Ops, the crashing was unexpected. I tested with the simple case and did not try with the |
I do not understand the |
p.s. |
Update: I have a feeling that |
@astrofrog , I am not sure if I want to drop the comments, because that requires making a copy of the table. Otherwise, the table object loses its comments just because |
Would silently applying |
Just to be clear, I'm only suggesting dropping it at the point of writing - that is, we would just not write them but still preserve them in the table. |
The path forward for this PR was unclear to me. Is there more changes I am supposed to do? If this cannot get in for 3.1, feel free to re-milestone. |
@pllim @astrofrog - what is the way forward for this PR? Shall we include it in 3.2? |
From #7801 (comment) , looks like I was confused and still am... 😬 |
I don't remember what I was doing anymore. |
Fix #7357
Might be painful to backport, especially to v2, so milestoning to 3.1, but please let me know if this needs to be re-milestoned.