Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A custom/unknonw measure fails when read from server #170

Closed
benedeki opened this issue Mar 14, 2024 · 0 comments · Fixed by #181
Closed

A custom/unknonw measure fails when read from server #170

benedeki opened this issue Mar 14, 2024 · 0 comments · Fixed by #181
Assignees
Labels
Agent Issues touching the agent part of the project bug Something isn't working

Comments

@benedeki
Copy link
Contributor

Describe the bug

When custom/unknown measure is added a later request of measure is requested from Atum server if fails with exception.

To Reproduce

Steps to reproduce the behavior OR commands run:

  1. Add a UnknownMeasure to an AtumPartitioing
  2. Request the AtumContext
  3. Exception is thrown

Responsible code

  private def createMeasure(measure: MeasureDTO): za.co.absa.atum.agent.model.AtumMeasure = {
    val measuredColumns = measure.measuredColumns

    measure.measureName match {
      case RecordCount.measureName            => RecordCount()
      case DistinctRecordCount.measureName    => DistinctRecordCount(measuredColumns)
      case SumOfValuesOfColumn.measureName    => SumOfValuesOfColumn(measuredColumns.head)
      case AbsSumOfValuesOfColumn.measureName => AbsSumOfValuesOfColumn(measuredColumns.head)
      case SumOfHashesOfColumn.measureName    => SumOfHashesOfColumn(measuredColumns.head)
      case unsupportedMeasure =>
        throw MeasureException(
          s"Measure not supported: $unsupportedMeasure. Supported measures are: ${AtumMeasure.supportedMeasureNames}"
        )
    }
  }

Expected behavior

Instance of UnknownMeasure is created. And it won't be evaluated on createCheckpoint call.

@benedeki benedeki added bug Something isn't working Agent Issues touching the agent part of the project labels Mar 14, 2024
@benedeki benedeki added this to the Atum release 0.2 milestone Mar 14, 2024
@benedeki benedeki moved this from 🆕 To groom to 📋 Backlog in CPS small repos project Mar 18, 2024
@salamonpavel salamonpavel self-assigned this Mar 19, 2024
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in CPS small repos project Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Agent Issues touching the agent part of the project bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants