-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
gh-134861: Add CSV and 🍌SV output formats to asyncio ps
#134862
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
base: main
Are you sure you want to change the base?
Conversation
# Conflicts: # Lib/asyncio/tools.py
(Skipping news because this is an easter egg) |
@ZeroIntensity Hmm... But isn't the CSV format legit, so in my (very bad) opinion it still need news? |
Oh, hm. I guess we could add an entry for only CSV. I'll leave the decision to @dpdani. |
Yes, please add news for CSV format |
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, agreed with the NEWS part. But might it make the Easter Egg too obvious? Since people can just look at the PR through news. I think we might be able to split up the PRs into CSV and BSV and skip news on the latter, but it might be too much work.
We're not trying to hide or obsfucate; just not to advertise. |
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Sure, resolve.
|
# Conflicts: # Lib/asyncio/tools.py
Lib/asyncio/tools.py
Outdated
@@ -264,7 +264,7 @@ def display_awaited_by_tasks_table( | |||
def _display_awaited_by_tasks_table(table) -> None: | |||
# Print the table in a simple tabular format | |||
print( | |||
f"{_header[0]:<10} {_header[1]:<20} {_header[2]:<20} {_header[3]:<50} {_header[4]:<20} {_header[5]:<15}" | |||
f"{_header[0]:<10} {_header[1]:<20} {_header[2]:<20} {_header[3]:<50} {_header[4]:<50} {_header[5]:<15} {_header[6]:<15}" |
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.
Try storing the numbers in either another array or a tulle with headers and for loop this print.
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.
Hi John 👋
I don't think it would make the code significantly cleaner, if that was your intent.
Also those numbers are only used in this function so it makes sense they only appear here.
My guess is you want to avoid the repetition of the numbers on line 271 below, but again I don't think it's particularly harmful.
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.
Feel free to disagree, but writing header[0] header[1] etc makes it hard to read which property is associated with which length.
Thank you for your consideration.
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.
I agree that the proposed change is harder to read/comprehend; reverting would be helpful.
can someone give this another look? |
Lib/asyncio/tools.py
Outdated
@@ -264,7 +264,7 @@ def display_awaited_by_tasks_table( | |||
def _display_awaited_by_tasks_table(table) -> None: | |||
# Print the table in a simple tabular format | |||
print( | |||
f"{_header[0]:<10} {_header[1]:<20} {_header[2]:<20} {_header[3]:<50} {_header[4]:<20} {_header[5]:<15}" | |||
f"{_header[0]:<10} {_header[1]:<20} {_header[2]:<20} {_header[3]:<50} {_header[4]:<50} {_header[5]:<15} {_header[6]:<15}" |
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.
I agree that the proposed change is harder to read/comprehend; reverting would be helpful.
Lib/asyncio/tools.py
Outdated
@@ -5,6 +5,8 @@ | |||
from enum import Enum | |||
import sys | |||
from _remote_debugging import RemoteUnwinder, FrameInfo | |||
import csv |
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.
Please keep the list sorted
# As per the words of the asyncio 🍌SV spec lead: | ||
# > 🍌SV is not just a format. It’s a lifestyle. A philosophy. |
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.
What's the "🍌SV spec"? I don't recall CSV/etc being mentioned in the talk. Perhaps just keep the epigraph (with a time code link, the youtube transcript doesn't have results for the quotation).
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.
It was a reference to this comment: #134861 (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.
In that case, shall we use the more relevant link?
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.
Or should we keep just the quote?
Lib/asyncio/tools.py
Outdated
def display_awaited_by_tasks_table( | ||
pid: int, | ||
format_: TaskTableOutputFormat | str = TaskTableOutputFormat.table | ||
) -> None: |
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.
Also remove the underscore from format_
?
def display_awaited_by_tasks_table( | |
pid: int, | |
format_: TaskTableOutputFormat | str = TaskTableOutputFormat.table | |
) -> None: | |
def display_awaited_by_tasks_table(pid, format_=TaskTableOutputFormat.table): |
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.
I have not removed the type annotations because they were already otherwise present in this file
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.
They're needlessly verbose here, hence the suggestion.
Misc/NEWS.d/next/Library/2025-05-29-19-00-37.gh-issue-134861.y2-fu-.rst
Outdated
Show resolved
Hide resolved
…2-fu-.rst Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
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.
I hate to be the not-funny one here but, while I think it's ok to have the CSV format, I would honestly prefer that we don't slip secret formats in this PR. The #119535 easter egg had a separate issue and PR and I would honestly prefer that for this one.
I think there's not much point duplicating the issue now, but splitting into two PRs can make sense. @picnixz if you really think it's best, I can do the split. |
Yeah no need for two issues, but I would really like two separate PRs. For people reading commits, it's easier to spot the easter egg and it also makes reverting easier (if needed). It also allows us to make a funnier commit message. However, if @1st1 or any other codeowner is ok with adding the easter egg in this PR, I won't oppose their decision. EDIT: I pinged the wrong code owner |
asyncio ps
#134861