Skip to content
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

[SPARK-48650][PYTHON] Display correct call site from IPython Notebook #47009

Closed
wants to merge 6 commits into from

Conversation

itholic
Copy link
Contributor

@itholic itholic commented Jun 18, 2024

What changes were proposed in this pull request?

This PR proposes to display correct call site information from IPython Notebook.

Why are the changes needed?

We added DataFrameQueryContext for PySpark error message from #45377, but it does not working very well from IPython Notebook.

Does this PR introduce any user-facing change?

No API changes, but the user-facing error message from IPython Notebook will be improved:

Before
Screenshot 2024-06-18 at 5 15 56 PM

After
Screenshot 2024-06-19 at 8 45 05 AM

NOTE: This also works when command is executed across multiple cells:

Screenshot 2024-06-19 at 8 42 29 AM

How was this patch tested?

Manually tested with IPython Notebook.

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

No

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.

I feel the file name doesn't make much sense, but the line number really matters. Just a suggestion: is there a way to highlight the line number?

@itholic
Copy link
Contributor Author

itholic commented Jun 18, 2024

@allisonwang-db Actually that is a good point. Let me try highlighting and providing more useful debugging information from error message.

@itholic
Copy link
Contributor Author

itholic commented Jun 18, 2024

Now we use the cell number instead of file name for better debuggability.

Updated before/after in PR description. cc @allisonwang-db FYI

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.

This looks much better!

@HyukjinKwon
Copy link
Member

Merged to master.

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