Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 29, 2025

The DataRepository.apply method was returning a lambda function instead of a proper trait instance, breaking the type contract.

Changes

  • Replaced lambda (query, batchSize) => { ... } with anonymous class implementing DataRepository[F]
  • Added explicit override def streamData method declaration

Before/After

// Before: returns lambda, not DataRepository[F]
def apply[F[_]: Async](xa: Transactor[F]): DataRepository[F] =
  (query: String, batchSize: Int) => { ... }

// After: returns proper trait instance
def apply[F[_]: Async](xa: Transactor[F]): DataRepository[F] =
  new DataRepository[F] {
    override def streamData(query: String, batchSize: Int): Stream[F, SampleData] = { ... }
  }

This pattern matches the implementation in S3Writer.apply.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…ambda

Co-authored-by: akreit <64101884+akreit@users.noreply.github.com>
Copilot AI changed the title [WIP] Update changes based on feedback for Cats Logger Fix DataRepository to return trait implementation instead of lambda Dec 29, 2025
Copilot AI requested a review from akreit December 29, 2025 12:21
@akreit akreit marked this pull request as ready for review December 29, 2025 12:23
@akreit akreit merged commit 57e1272 into copilot/build-etl-pipeline-scala Dec 29, 2025
@akreit akreit deleted the copilot/sub-pr-2-another-one branch December 29, 2025 12:23
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.

2 participants