Skip to content

Conversation

itholic
Copy link
Contributor

@itholic itholic commented Jul 1, 2024

What changes were proposed in this pull request?

This PR proposes to fix internal function _capture_call_site for filtering out IPython-related frames from user stack.

Why are the changes needed?

IPython-related frames are unnecessarily polluting the user stacks so it harms debuggability of IPython Notebook.

For example, there are some garbage stacks recorded from IPython and ipykernel such as:

  • ...lib/python3.9/site-packages/IPython/core/interactiveshell.py...
  • ...lib/python3.9/site-packages/ipykernel/zmqshell.py...

Does this PR introduce any user-facing change?

No API changes, but the user stack from IPython will be cleaned up as below:

Before
Screenshot 2024-07-01 at 3 26 45 PM

After
Screenshot 2024-07-01 at 3 25 07 PM

How was this patch tested?

The existing CI should pass

Was this patch authored or co-authored using generative AI tooling?

No

@github-actions github-actions bot added the PYTHON label Jul 1, 2024
@itholic
Copy link
Contributor Author

itholic commented Jul 1, 2024

cc @grundprinzip @HyukjinKwon

Copy link
Contributor

@allisonwang-db allisonwang-db left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome!

@HyukjinKwon
Copy link
Member

Merged to master.

attilapiros pushed a commit to attilapiros/spark that referenced this pull request Oct 4, 2024
…stack

### What changes were proposed in this pull request?

This PR proposes to fix internal function `_capture_call_site` for filtering out IPython-related frames from user stack.

### Why are the changes needed?

IPython-related frames are unnecessarily polluting the user stacks so it harms debuggability of IPython Notebook.

For example, there are some garbage stacks recorded from `IPython` and `ipykernel` such as:

- `...lib/python3.9/site-packages/IPython/core/interactiveshell.py...`
- `...lib/python3.9/site-packages/ipykernel/zmqshell.py...`

### Does this PR introduce _any_ user-facing change?

No API changes, but the user stack from IPython will be cleaned up as below:

**Before**
<img width="457" alt="Screenshot 2024-07-01 at 3 26 45 PM" src="https://github.com/apache/spark/assets/44108233/67ba8b49-f52f-4a7d-8031-b7272fceb581">

**After**
<img width="456" alt="Screenshot 2024-07-01 at 3 25 07 PM" src="https://github.com/apache/spark/assets/44108233/950035cd-4397-41a5-9664-7040b84ebd6f">

### How was this patch tested?

The existing CI should pass

### Was this patch authored or co-authored using generative AI tooling?

No

Closes apache#47159 from itholic/ipython_followup.

Authored-by: Haejoon Lee <[email protected]>
Signed-off-by: Hyukjin Kwon <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants