uros-b opened a new pull request, #58381: URL: https://github.com/apache/spark/pull/58381
### What changes were proposed in this pull request? `LiveEntity.scala` builds several `Option` values with the `if (cond) Some(x) else None` idiom. This replaces the five such occurrences with the more idiomatic `Option.when(cond)(x)`: - `firstTaskLaunchedTime` in `LiveStage`; - the four on-/off-heap memory fields in `LiveRDDDistribution` (each guarded by `exec.hasMemoryInfo`). ### Why are the changes needed? `Option.when` reads more directly than the `if`/`else` form and is already used across the codebase (e.g. `InjectRuntimeFilter`, `ParquetSchemaConverter`). This is a small readability cleanup. ### Does this PR introduce _any_ user-facing change? No. `Option.when(cond)(x)` evaluates its by-name value only when the condition holds, exactly like `if (cond) Some(x) else None`, so the produced `Option` values are identical. ### How was this patch tested? Existing tests. This is a behavior-preserving refactor; `core` compiles cleanly and its tests are unaffected. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 4.8) -- 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]
