-
Notifications
You must be signed in to change notification settings - Fork 14
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
Use error message type from spark commons: 2170 #2177
base: develop
Are you sure you want to change the base?
Use error message type from spark commons: 2170 #2177
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems class ErrorMessageFactory
can be safely deleted too.
Does not build 😞 Several files still refer to old classes.
import za.co.absa.enceladus.utils.modules._ | ||
import za.co.absa.spark.commons.implicits.StructTypeImplicits.StructTypeEnhancements | ||
import za.co.absa.abris.avro.functions.to_avro | ||
import za.co.absa.abris.config.{AbrisConfig, ToAvroConfig} | ||
import za.co.absa.enceladus.plugins.builtin.errorsender.mq.kafka.KafkaErrorSenderPlugin.{avroKeySchemaRegistryConfig, avroValueSchemaRegistryConfig, registerSchemas} | ||
import za.co.absa.enceladus.utils.error.EnceladusErrorMessage.ErrorCodes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor:
Some unused imports.
@@ -28,19 +28,18 @@ import za.co.absa.enceladus.conformance.config.ConformanceConfigParser | |||
import za.co.absa.enceladus.conformance.datasource.PartitioningUtils | |||
import za.co.absa.enceladus.conformance.interpreter.rules._ | |||
import za.co.absa.enceladus.conformance.interpreter.rules.custom.CustomConformanceRule | |||
import za.co.absa.enceladus.conformance.interpreter.rules.mapping.{MappingRuleInterpreter, MappingRuleInterpreterBroadcast, | |||
MappingRuleInterpreterGroupExplode} | |||
import za.co.absa.enceladus.conformance.interpreter.rules.mapping.{MappingRuleInterpreter, MappingRuleInterpreterBroadcast, MappingRuleInterpreterGroupExplode} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really minor:
Line is over 140 character long.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about what I should do here, or should I just import everything from maping e.g. za.co.absa.enceladus.conformance.interpreter.rules.mapping._
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that multi-line imports should work:
import za.co.absa.enceladus.conformance.interpreter.rules.mapping.{
MappingRuleInterpreter, MappingRuleInterpreterBroadcast, MappingRuleInterpreterGroupExplode
}
that can be one way how to resolve this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it does work, but gives a warning. But I have refactored it now.
@@ -25,6 +25,7 @@ import za.co.absa.enceladus.model.conformanceRule.{ConformanceRule, MappingConfo | |||
import za.co.absa.enceladus.model.{Dataset => ConfDataset} | |||
import za.co.absa.enceladus.utils.error._ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes looks good to me, but the code still won't compile because there are some places where it fails on wrong imports, as David said before.
Once it's fixed, I can quickly test it.
…ErrorMessage-type-from-spark-commons
import za.co.absa.enceladus.utils.modules._ | ||
import za.co.absa.spark.commons.implicits.StructTypeImplicits.StructTypeEnhancements | ||
import za.co.absa.abris.avro.functions.to_avro | ||
import za.co.absa.abris.config.{AbrisConfig, ToAvroConfig} | ||
import za.co.absa.abris.config.{ToAvroConfig} | ||
import za.co.absa.enceladus.plugins.builtin.errorsender.mq.kafka.KafkaErrorSenderPlugin.{avroKeySchemaRegistryConfig, avroValueSchemaRegistryConfig, registerSchemas} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line has 166 chars
...n/scala/za/co/absa/enceladus/plugins/builtin/errorsender/mq/KafkaErrorSenderPluginImpl.scala
Outdated
Show resolved
Hide resolved
@@ -47,6 +47,7 @@ class StandardizationRerunSuite extends FixtureAnyFunSuite with TZNormalizedSpar | |||
private val tmpFilePrefix = "test-input-" | |||
private val tmpFileSuffix = ".csv" | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary empty line
@@ -29,13 +30,13 @@ import za.co.absa.standardization.config.DefaultErrorCodesConfig | |||
* @param rawValues - Sequence of raw values (which are the potential culprits of the error) | |||
* @param mappings - Sequence of Mappings i.e Mapping Table Column -> Equivalent Mapped Dataset column | |||
*/ | |||
case class ErrorMessage(errType: String, errCode: String, errMsg: String, errCol: String, rawValues: Seq[String], mappings: Seq[Mapping] = Seq()) | |||
case class Mapping(mappingTableColumn: String, mappedDatasetColumn: String) | |||
//case class ErrorMessage(errType: String, errCode: String, errMsg: String, errCol: String, rawValues: Seq[String], mappings: Seq[Mapping] = Seq()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dead code here and below
@@ -18,8 +18,9 @@ package za.co.absa.enceladus.utils.broadcast | |||
import org.apache.spark.sql.functions._ | |||
import org.apache.spark.sql.{DataFrame, Row} | |||
import org.scalatest.wordspec.AnyWordSpec | |||
import za.co.absa.enceladus.utils.error.Mapping | |||
import za.co.absa.enceladus.utils.error.EnceladusErrorMessage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have that file in my local branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how's that possible, did you remove it? What git status
tells you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I found some minor issues, most of them just formatting.
- code reviewed
- pulled
- built
- ran tests
…iltin/errorsender/mq/KafkaErrorSenderPluginImpl.scala Co-authored-by: Ladislav Sulak <laco.sulak@gmail.com>
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
I am sorry, I am afraid this PR become obsolete with |
Changes
ErrorMessage
case classMapping
case classerrorColumnName
propertyEnceladus ErrorMessage
file and the Object toEnceladusErrorMessage
Enceladus ErrorMerssage
with spark-commonErrorMessages
ErrorMessage
type from spark-commons #2170