Skip to content

Conversation

@salamonpavel
Copy link
Collaborator

Release notes:

  • saveCheckpoint operation in HttpDispatcher uses v2 endpoints

Closes #348

…8-create-checkpoint-v2

# Conflicts:
#	agent/src/main/scala/za/co/absa/atum/agent/dispatcher/HttpDispatcher.scala
val parentPartitioningIdOpt = partitioning.parentPartitioning.map(getPartitioningId)
val partitioningWithIdOpt = getPartitioning(partitioning.partitioning)


Copy link
Collaborator

Choose a reason for hiding this comment

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

unnecessary empty lines

.as[SingleSuccessResponse[AdditionalDataDTO.Data]]
.data
.map(item => item._1 -> item._2.map(_.value))

Copy link
Collaborator

Choose a reason for hiding this comment

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

unnecessary empty lines


// Could be different from the one that was submitted. Replacing, just to have the most fresh copy possible.
this.additionalData = retrievedAD.data.map { case (k, v) => (k, v.map(_.value)) }
this.additionalData = retrievedAD.data.map { case (k, v) => (k, v.map(_.value)) }.toMap
Copy link
Collaborator

Choose a reason for hiding this comment

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

this shouldn't be needed


import java.time.ZonedDateTime

@Ignore // has to be run with a real server
Copy link
Collaborator

Choose a reason for hiding this comment

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

if it's so, then it is no longer a unit test. If we want to have unit tests here in this file, then we have to mock

Copy link
Collaborator

Choose a reason for hiding this comment

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

what changed? It used to be runnable 'locally' without the server, am I mistaken?

val flywayUrl = s"jdbc:postgresql://$host:$port/$database"
val flywayUser = "postgres"
val flywayPassword = "postgres"
val flywayPassword = "changeme"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I see that you made this change on all places, what's the reason?

.in(V2Paths.Partitionings / path[Long]("partitioningId") / V2Paths.AdditionalData)
.out(statusCode(StatusCode.Ok))
.out(jsonBody[SingleSuccessResponse[AdditionalDataDTO.Data]])
.out(jsonBody[MultiSuccessResponse[AdditionalDataItemV2DTO]])
Copy link
Collaborator

Choose a reason for hiding this comment

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

On one hand, I liked the SingleSuccessResponse[AdditionalDataDTO.Data] because it 'restricts' the duplication of same AD key, by the 'contract' it's immediatelly & explicitly obvious.

On another hand, I like MultiSuccessResponse[AdditionalDataItemV2DTO]] because it is more 'explicit' and precise on what is key, author, and value - and can be extended easily. Map of X and Y cannot be as easily.

So let's carry on with the implementation. It's same as for Measures. But it's important to know that we changed the contract here.

import io.circe.{Decoder, Encoder}
import io.circe.generic.semiauto.{deriveDecoder, deriveEncoder}

case class AdditionalDataItemV2DTO(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok, this structure makes sense to me.

But when I look at model/ now, it's very ... rich. I think that AdditionalDataDTO is only used for AD Update. What do you think about renaming it to UpdateAdditionalDataDTO ?

Please double check.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Update: I noticed 1 more place where it's used, in Reader, in getAdditionalData - but I like that your structure AdditionalDataItemV2DTO more, and luckily we are not using this in UU project.

*/
type AtumPartitions = ListMap[String, String]
type AdditionalData = Map[String, Option[String]]
type AdditionalData = Map[String, Option[String]] // why did we decide for the optionality of the value here?
Copy link
Collaborator

Choose a reason for hiding this comment

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

IIRC AD value can be empty in general, we didn't want to restrict our users. It can be a prepared field, to be filled in later, or a part of patterns (we so far haven't really implemented / talked to that much)

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