-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Fix tabulate col size in case of empty cell #7988
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
8fff440
to
692b39c
Compare
Previously, the size is no less than len(str(None)) == 4. This commit also add type hint and docstring to the function.
Do we agree that this case never happens in pip's code base ? A simple parametrized test would also be a nice touch 👼 |
Sorry I did not give the context, I was preparing for GH-7975 and there might be (I don't think it's settled) some narrow columns. Additionally, should we move the function to utils.misc?
That won't be a problem! |
Moving it to utils.misc is a good idea if you plan to use it for |
Scratch that, I see the problem here is |
That was the problem, which will be fixedby this PR. Consider the current implementation:
Fly away writing some tests for this after a full day of long and hard lectures. Edit: Just want to point out how long it takes me to respond that uranusjr found the anwser himself 😆 |
Trivial is fine, since there's not really going to be any signficant user facing changes here IMO. |
Since the change is quite trivial (pun intended), may I get this merged now? |
Thanks @McSinyx |
Previously, the size is no less than
len(str(None)) == 4
.This commit also add type hint and docstring to the function.
Edit: I'm not sure if this change is trivial, please tell me if news is required.