apache / apache/datafusion-comet

chore: Clear remaining Scala 2.13 warnings under the strict-warnings profile

Open
#5,893 0 comments 0 reactions 0 assignees View on GitHub
requires-triage
Dominant language
Scala
Stars
1.3k
Forks
373
Avg merge
2d 4h
Merged PRs (30d)
198

Description

After #5876, `-Pstrict-warnings` passes on the Scala 2.12 profiles and CI enforces it for Spark 3.5. The Scala 2.13 profiles still fail. `./mvnw test-compile -Pspark-4.0 -Pstrict-warnings` reported 100 warnings at the time #5876 was opened (83 main, 17 test), nearly all in categories 2.12 does not raise:

- `-Xlint:nonlocal-return` (42): a `return` inside a closure, which the compiler implements by throwing. 17 are in `CometIcebergNativeWrite.scala`.
- Non-exhaustive matches (20).
- 2.13 collection deprecations (11): `JavaConverters`, `Stream`, `MapOps.retain`.
- A handful of widenings, shadowed names and inferred `Any`/`Object`.

These were left out of #5876 because the first two need control-flow changes rather than annotations.

Done when `./mvnw test-compile -Pspark-4.0 -Pstrict-warnings -DskipTests` passes and the `strict-scala-warnings` CI job also covers a 2.13 profile.

Contributor guide

Open the contributing guide

Research direction

Start by running ./mvnw test-compile -Pspark-4.0 -Pstrict-warnings -DskipTests and inspect the reported Scala 2.13 warnings, including the 17 in CometIcebergNativeWrite.scala. Address the listed control-flow, match, collection, widening, shadowing and inferred-type warnings, then confirm the command passes and the strict-scala-warnings CI job covers a 2.13 profile.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
build-system, ci-cd
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.