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

TANGO 2130 #1903

Merged
merged 6 commits into from
Oct 4, 2024
Merged

TANGO 2130 #1903

merged 6 commits into from
Oct 4, 2024

Conversation

adamallegro
Copy link
Collaborator

  • TANGO-2130 : Tests for primitive types
  • TANGO-2130 : Array and Map primitives - tests
  • TANGO-2130 : Checkpoint after primitives
  • TANGO-2130 : Unit tests for records and for simple type mappings
  • TANGO-2130 : Updated and refactored tests

if (value instanceof Boolean) {
return value;
} else if (value instanceof Number) {
return ((Number) value).intValue() > 0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it really how the int field should be casted to boolean? I would have used ((Number) value).intValue() != 0

return new Schema.Parser().parse(AvroTrait.class.getClassLoader().getResourceAsStream("schemas/${fileName}.avsc"))
}

GenericRecord getGenericRecordFromFile(String payloadFile, Schema schema) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think you use this method in the code here as it's intended to read .avro files without headers.


where:
suite | avroType | protoDescriptor | avroValue | expectedProtoValue | transformResult
"primitives" | "string" | StringProto.PrimitivesString.getDescriptor() | "value" | "value" | { c -> c }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do you need transformResult variable if all provided values are the same (identity func)?

@adamallegro adamallegro merged commit 46ed8b3 into bigquery-sender Oct 4, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants