Skip to content

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

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

dpdani
Copy link
Contributor

@dpdani dpdani commented May 28, 2025

# Conflicts:
#	Lib/asyncio/tools.py
@ZeroIntensity
Copy link
Member

(Skipping news because this is an easter egg)

@johnzhou721
Copy link
Contributor

@ZeroIntensity Hmm... But isn't the CSV format legit, so in my (very bad) opinion it still need news?

@ZeroIntensity
Copy link
Member

Oh, hm. I guess we could add an entry for only CSV. I'll leave the decision to @dpdani.

@AA-Turner
Copy link
Member

@ZeroIntensity Hmm... But isn't the CSV format legit, so in my (very bad) opinion it still need news?

Yes, please add news for CSV format

Copy link
Contributor

@johnzhou721 johnzhou721 left a 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.

@AA-Turner
Copy link
Member

AA-Turner commented May 29, 2025

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>
@python-cla-bot
Copy link

python-cla-bot bot commented May 29, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

@johnzhou721
Copy link
Contributor

johnzhou721 commented May 29, 2025 via email

johnzhou721

This comment was marked as outdated.

# Conflicts:
#	Lib/asyncio/tools.py
@@ -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}"
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Member

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.

@dpdani dpdani requested a review from AA-Turner August 1, 2025 18:02
@dpdani
Copy link
Contributor Author

dpdani commented Aug 1, 2025

can someone give this another look?

@@ -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}"
Copy link
Member

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.

@@ -5,6 +5,8 @@
from enum import Enum
import sys
from _remote_debugging import RemoteUnwinder, FrameInfo
import csv
Copy link
Member

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

Comment on lines +241 to +242
# As per the words of the asyncio 🍌SV spec lead:
# > 🍌SV is not just a format. It’s a lifestyle. A philosophy.
Copy link
Member

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).

Copy link
Contributor Author

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)

Copy link
Member

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?

Copy link
Contributor Author

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?

Comment on lines 249 to 252
def display_awaited_by_tasks_table(
pid: int,
format_: TaskTableOutputFormat | str = TaskTableOutputFormat.table
) -> None:
Copy link
Member

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_?

Suggested change
def display_awaited_by_tasks_table(
pid: int,
format_: TaskTableOutputFormat | str = TaskTableOutputFormat.table
) -> None:
def display_awaited_by_tasks_table(pid, format_=TaskTableOutputFormat.table):

Copy link
Contributor Author

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

Copy link
Member

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.

…2-fu-.rst

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Copy link
Member

@picnixz picnixz left a 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.

@dpdani
Copy link
Contributor Author

dpdani commented Aug 1, 2025

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.

@picnixz
Copy link
Member

picnixz commented Aug 1, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy