ryan-johnson-databricks commented on code in PR #37573:
URL: https://github.com/apache/spark/pull/37573#discussion_r950160112
##########
connector/avro/src/main/scala/org/apache/spark/sql/avro/AvroFileFormat.scala:
##########
@@ -115,11 +115,7 @@ private[sql] class AvroFileFormat extends FileFormat
// Ensure that the reader is closed even if the task fails or doesn't
consume the entire
// iterator of records.
- Option(TaskContext.get()).foreach { taskContext =>
- taskContext.addTaskCompletionListener[Unit] { _ =>
- reader.close()
- }
- }
+ Option(TaskContext.get()).foreach(_.addTaskCompletionListener(_ =>
reader.close()))
Review Comment:
Generally, yes -- tho they sometimes don't fit on one line until the
`[Unit]` gets deleted.
--
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]