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

Get Atum Context, by getting existing partitioning from DB - retrieve Measures and AdditionalData for a given partitioning #120 #167

Conversation

TebaleloS
Copy link
Collaborator

@TebaleloS TebaleloS commented Mar 11, 2024

Partitioning DB-Functions Calls

  • Added class to call partitioning measures function
  • Added class to call partitioning additional data DB function
  • Defined two methods getPartitioningMeasures and getPartitioningAdditionalData and implemented them.
  • Defined and implemented a method in the service returnAtumContext to package the above two methods including createPartitioningIfNotExists method in order to return the desired atum context.
  • Added few test-cases for the newly added code.
  • Included some test cases for createOrUpdateAdditionalData method as well.

closes #120

@TebaleloS TebaleloS self-assigned this Mar 11, 2024
@TebaleloS TebaleloS added the work in progress Work on this item is not yet finished (mainly intended for PRs) label Mar 11, 2024
…nd-AdditionalData-for-a-given-partitioning' into feature/#120-retrieve-Measures-and-AdditionalData-for-a-given-partitioning
…nalData-for-a-given-partitioning

# Conflicts:
#	server/src/main/scala/za/co/absa/atum/server/Main.scala
#	server/src/main/scala/za/co/absa/atum/server/api/controller/PartitioningController.scala
#	server/src/main/scala/za/co/absa/atum/server/api/repository/PartitioningRepository.scala
#	server/src/main/scala/za/co/absa/atum/server/api/service/PartitioningService.scala
@TebaleloS
Copy link
Collaborator Author

TebaleloS commented Apr 19, 2024

Addressed all the comment.
No integration testing was done in this PR, only the mocks were performed.

@TebaleloS TebaleloS force-pushed the feature/#120-retrieve-Measures-and-AdditionalData-for-a-given-partitioning branch from 450a45f to d1b6f7c Compare April 26, 2024 07:31
TebaleloS and others added 6 commits April 26, 2024 09:36
…#120-retrieve-Measures-and-AdditionalData-for-a-given-partitioning

# Conflicts:
#	database/src/main/postgres/flows/V1.7.4__flows.alter.ddl
#	database/src/test/scala/za/co/absa/atum/database/runs/GetPartitioningAdditionalDataTest.scala
#	database/src/test/scala/za/co/absa/atum/database/runs/GetPartitioningMeasuresTest.scala
lsulak
lsulak previously approved these changes Apr 26, 2024
Copy link
Collaborator

@lsulak lsulak left a comment

Choose a reason for hiding this comment

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

LGTM, can be merged - the only thing I have is that we already have these 2 functions in the repository and I don't know what that would do to integration tests and/or Flyway, as their definitions are the same.

lsulak
lsulak previously approved these changes Apr 26, 2024
benedeki
benedeki previously approved these changes Apr 26, 2024
Copy link
Contributor

@benedeki benedeki left a comment

Choose a reason for hiding this comment

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

The latest little comments don't warrant postponing the merge. It's good already. 😸

@@ -26,7 +26,9 @@ import zio._
class PartitioningControllerImpl(partitioningService: PartitioningService)
extends PartitioningController with BaseController {

override def createPartitioningIfNotExists(partitioningSubmitDTO: PartitioningSubmitDTO): IO[ErrorResponse, AtumContextDTO] = {
override def createPartitioningIfNotExists(
Copy link
Contributor

Choose a reason for hiding this comment

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

Tiny:
Weird allignment

protected val partitioningDTO2: PartitioningDTO = Seq(PartitionDTO("Invali", "invalid"), PartitionDTO("invalid", "invalid"))
protected val partitioningDTO1: PartitioningDTO = Seq(
PartitionDTO("key1", "val1"),
PartitionDTO("key2", "val2")
Copy link
Contributor

Choose a reason for hiding this comment

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

Nah, let it be. What I meant was, that a bigger variability in test cases (record count), would cover more of the testable space. But this is already good enough 😉

@@ -23,6 +23,6 @@ import zio.macros.accessible

@accessible
trait PartitioningController {
def createPartitioningIfNotExists(partitioning: PartitioningSubmitDTO): IO[ErrorResponse, AtumContextDTO]
def createPartitioningIfNotExists(partitioningSubmitDTO: PartitioningSubmitDTO): IO[ErrorResponse, AtumContextDTO]
Copy link
Contributor

Choose a reason for hiding this comment

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

OK, good reason. It's just it's not the best idea to put the type name into the parameter/variable name (only with rare exceptions). Next time I would for example use submittedPartitioning: PartitioningSubmitDTO.

But don't change it anymore! It's OK, good enough 😉

@AbsaOSS AbsaOSS deleted a comment from github-actions bot Apr 29, 2024
@AbsaOSS AbsaOSS deleted a comment from github-actions bot Apr 29, 2024
@AbsaOSS AbsaOSS deleted a comment from github-actions bot Apr 29, 2024
Copy link

github-actions bot commented Apr 29, 2024

JaCoCo server module code coverage report - scala 2.13.11

Overall Project 76.61% -9.59% 🍏
Files changed 85.1% 🍏

File Coverage
PartitioningRepositoryImpl.scala 100% 🍏
PartitioningControllerImpl.scala 100% 🍏
PartitioningServiceImpl.scala 100% 🍏
GetPartitioningMeasures.scala 71.18% -35.37% 🍏
GetPartitioningAdditionalData.scala 70.56% -35.93% 🍏

@benedeki benedeki dismissed stale reviews from lsulak and themself via 57ffa95 April 29, 2024 07:47
@TebaleloS TebaleloS merged commit 4d83d79 into master Apr 30, 2024
9 checks passed
@TebaleloS TebaleloS deleted the feature/#120-retrieve-Measures-and-AdditionalData-for-a-given-partitioning branch April 30, 2024 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants