Skip to content

Commit

Permalink
fix: BQ Numeric is compatible with double and float protobuf types (#367
Browse files Browse the repository at this point in the history
)

Fixed a bug and made BQ Numeric compatible with double and float protobuf types.
  • Loading branch information
allenc3 committed Jun 22, 2020
1 parent 67626bd commit 1b2f110
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Expand Up @@ -206,6 +206,11 @@ private static boolean isCompatibleWithBQNumeric(Descriptors.FieldDescriptor.Typ
return true;
}

if (field == Descriptors.FieldDescriptor.Type.FLOAT
|| field == Descriptors.FieldDescriptor.Type.DOUBLE) {
return true;
}

return false;
}

Expand Down
Expand Up @@ -729,7 +729,9 @@ public void testBQNumeric() {
Fixed64Type.getDescriptor(),
SFixed32Type.getDescriptor(),
SFixed64Type.getDescriptor(),
BytesType.getDescriptor()));
BytesType.getDescriptor(),
FloatType.getDescriptor(),
DoubleType.getDescriptor()));

for (Descriptors.Descriptor descriptor : type_descriptors) {
if (compatible.contains(descriptor)) {
Expand Down

0 comments on commit 1b2f110

Please sign in to comment.