spotify / scio

A Scala API for Apache Beam and Google Cloud Dataflow.
https://spotify.github.io/scio
Apache License 2.0
2.56k stars 513 forks source link

use noOp cache instead of null when instantiating typedSparkeySideInput #5469

Closed pgoggijr closed 2 months ago

pgoggijr commented 2 months ago

When attempting to access an element in a side input instantiated by typedSparkeySideInput where cache isn't specified, the following error is thrown since the cache is explicitly set to null:

Error message from worker: java.lang.NullPointerException: Cannot invoke "com.spotify.scio.util.Cache.get(Object, scala.Function0)" because the return value of "com.spotify.scio.extra.sparkey.instances.TypedSparkeyReader.cache()" is null
    com.spotify.scio.extra.sparkey.instances.TypedSparkeyReader.get(TypedSparkeyReader.scala:42)
    com.spotify.scio.extra.sparkey.instances.TypedSparkeyReader.get(TypedSparkeyReader.scala:31)
codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 61.30%. Comparing base (2fe2258) to head (62a901b). Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...scala/com/spotify/scio/extra/sparkey/package.scala 0.00% 3 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #5469 +/- ## ========================================== - Coverage 61.31% 61.30% -0.01% ========================================== Files 312 312 Lines 11068 11070 +2 Branches 792 773 -19 ========================================== + Hits 6786 6787 +1 - Misses 4282 4283 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.