gaogaotiantian commented on code in PR #58191:
URL: https://github.com/apache/spark/pull/58191#discussion_r3849240315
##########
python/pyspark/sql/datasource_internal.py:
##########
@@ -162,11 +162,10 @@ def getCache(self, start: dict, end: dict) ->
Optional[Iterator[Tuple]]:
it = chain(*entries)
return it
- def read(
- self,
- input_partition: SimpleInputPartition, # type: ignore[override]
- ) -> Iterator[Tuple]:
- return self.simple_reader.readBetweenOffsets(input_partition.start,
input_partition.end)
+ def read(self, partition: InputPartition) -> Iterator[Tuple]:
+ # partitions() only yields SimpleInputPartition. Cast keeps the ABC
override valid.
+ simple_partition = cast(SimpleInputPartition, partition)
Review Comment:
`cast` won't raise any error - it's basically a noop in runtime, but that
does not make this change correct.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]