-
Notifications
You must be signed in to change notification settings - Fork 15
Use error message type from spark commons: 2170 #2177
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
base: develop
Are you sure you want to change the base?
Use error message type from spark commons: 2170 #2177
Conversation
benedeki
left a comment
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.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.
| 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.
| import za.co.absa.enceladus.dao.EnceladusDAO | ||
| import za.co.absa.enceladus.model.conformanceRule.{ConformanceRule, MappingConformanceRule} | ||
| 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.
lsulak
left a comment
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.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
| 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
| */ | ||
| 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
| 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?
lsulak
left a comment
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!
|
|
I am sorry, I am afraid this PR become obsolete with |








Changes
ErrorMessagecase classMappingcase classerrorColumnNamepropertyEnceladus ErrorMessagefile and the Object toEnceladusErrorMessageEnceladus ErrorMerssagewith spark-commonErrorMessagesErrorMessagetype from spark-commons #2170