-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Fix problem where bad column format is not reverted #6812
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
|
Hi there @taldcroft 👋 - 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 😃. Everything looks good from my point of view! 👍 If there are any issues with this message, please report them here. |
astropy/table/column.py
Outdated
| # test whether it formats without error exemplarily | ||
| self.pformat(max_lines=1) | ||
| except TypeError as err: | ||
| except (TypeError, ValueError) as err: |
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.
Shouldn't we just catch any exception here? I.e., except Exception as err?
Also, I may have worried about this before, but what happens if the first element is masked? I vaguely recall writing delayed formatting for that case, and max_lines=1 might then not catch it. Perhaps too much of a detail, though.
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.
So, I should read all my e-mail before commenting. So indeed I wrote about this 24 days ago (just tells you how long my memory lasts these days...)
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.
Bottom line: happy with this, though I'd use Exception - seems justified to be general in this case, since we re-raise it as a ValueError anyway.
5d508ca to
b6a31c5
Compare
|
@mhvk - OK made the change to |
mhvk
left a comment
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.
OK, all looks fine; merging...
|
Since #6385 was milestoned to 3.0, this cannot be backported, and also doesn't yet affect release. |
|
Since this is now affect-dev, do you still want the changelog entry? Currently it has been removed, but I can add it back is you feel the need for it. |
#6385 added code to validate
formatwhen it is set, but in the mean time the expectedTypeErrorgot changed to aValueError. The unit testing of this just checks for aValueErrorbut does not check that theformatgot reverted.