Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[SPARK-48764][PYTHON] Filtering out IPython frame from user stack
  • Loading branch information
itholic committed Jul 1, 2024
commit e76d2c78fa3eefdac527d89c7e4a86d4a7073bd7
7 changes: 5 additions & 2 deletions python/pyspark/errors/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,12 @@ def _capture_call_site(spark_session: "SparkSession", depth: int) -> str:

# We try import here since IPython is not a required dependency
try:
from IPython import get_ipython
import IPython

ipython = get_ipython()
ipython = IPython.get_ipython()
# Filtering out IPython frame
ipy_root = os.path.dirname(IPython.__file__)
selected_frames = [frame for frame in selected_frames if ipy_root not in frame.filename]
except ImportError:
ipython = None

Expand Down