Skip to content

Conversation

@shnapz
Copy link
Contributor

@shnapz shnapz commented Jul 2, 2025

No description provided.

@codecov
Copy link

codecov bot commented Jul 2, 2025

Codecov Report

Attention: Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.

Project coverage is 61.47%. Comparing base (36db465) to head (0ed0cbf).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...e/src/main/scala/com/spotify/scio/ScioResult.scala 85.71% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5718   +/-   ##
=======================================
  Coverage   61.46%   61.47%           
=======================================
  Files         314      314           
  Lines       11354    11358    +4     
  Branches      789      808   +19     
=======================================
+ Hits         6979     6982    +3     
- Misses       4375     4376    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@shnapz shnapz changed the title Configure metricsLocation from env var SCIO_LINEAGE_LOCATION Don't fail on saveMetrics and saveLineage Jul 9, 2025
@shnapz shnapz requested a review from clairemcginty July 9, 2025 21:58
}

private def saveJsonFile(resourceId: ResourceId, value: Object): Unit = {
private def saveJsonFile(resourceId: => ResourceId, path: String, value: Object): Unit = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, where is path getting used in this method outside of the logging? can we just log the resourceID directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the problem is that creation of resourceId can fail if bucket does not exist

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's ok; if we do:

      logger.info(f"Saved metrics to '$resourceId'")
    } catch {
      case e: Throwable =>
        logger.warn(
          f"Failed to save metrics: ${mapper.writeValueAsString(value)}",
          e
        )

in the success case, the resourceID exists so it's safe to log, and in the failure case, the error msg would include the path anyway, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually I re-tested it and resourceID is safely created even if bucket does not exist! So I have updated the code and replaced path with resourceId!

@shnapz shnapz marked this pull request as ready for review July 10, 2025 14:34
@shnapz shnapz requested a review from clairemcginty July 10, 2025 14:37
}

private def saveJsonFile(resourceId: ResourceId, value: Object): Unit = {
private def saveJsonFile(resourceId: => ResourceId, path: String, value: Object): Unit = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's ok; if we do:

      logger.info(f"Saved metrics to '$resourceId'")
    } catch {
      case e: Throwable =>
        logger.warn(
          f"Failed to save metrics: ${mapper.writeValueAsString(value)}",
          e
        )

in the success case, the resourceID exists so it's safe to log, and in the failure case, the error msg would include the path anyway, right?

@shnapz shnapz requested a review from clairemcginty July 10, 2025 15:32
@shnapz shnapz marked this pull request as draft November 17, 2025 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants