Skip to content
Closed
Changes from all commits
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
7 changes: 6 additions & 1 deletion python/pyspark/sql/worker/plan_data_source_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,12 @@ def data_source_read_func(iterator: Iterable[pa.RecordBatch]) -> Iterable[pa.Rec

if not is_streaming:
# The partitioning of python batch source read is determined before query execution.
partitions = reader.partitions() # type: ignore[call-arg]
try:
partitions = reader.partitions() # type: ignore[call-arg]
except NotImplementedError:
# Backward compatibility for data sources that raise NotImplementedError for partitions
# Our old base class did this so an old client may still be using it.
partitions = [InputPartition(None)]
if not isinstance(partitions, list):
raise PySparkRuntimeError(
errorClass="DATA_SOURCE_TYPE_MISMATCH",
Expand Down