You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by da...@apache.org on 2024/11/13 20:48:07 UTC
(beam) branch users/damccorm/avro-cp created (now a062f31530c)
This is an automated email from the ASF dual-hosted git repository.
damccorm pushed a change to branch users/damccorm/avro-cp
in repository https://gitbox.apache.org/repos/asf/beam.git
at a062f31530c Make AvroUtils compatible with older versions of Avro (#33102)
This branch includes the following new commits:
new a062f31530c Make AvroUtils compatible with older versions of Avro (#33102)
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(beam) 01/01: Make AvroUtils compatible with older versions of Avro (#33102)
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
damccorm pushed a commit to branch users/damccorm/avro-cp
in repository https://gitbox.apache.org/repos/asf/beam.git
commit a062f31530c23439a9c6ec3de771864b66f02725
Author: Danny McCormick <da...@google.com>
AuthorDate: Wed Nov 13 15:47:30 2024 -0500
Make AvroUtils compatible with older versions of Avro (#33102)
* Make AvroUtils compatible with older versions of Avro
* Create beam_PostCommit_Java_Avro_Versions.json
* Update AvroUtils.java
* Fix nullness
---
.github/trigger_files/beam_PostCommit_Java_Avro_Versions.json | 4 ++++
.../apache/beam/sdk/extensions/avro/schemas/utils/AvroUtils.java | 8 ++++++--
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/.github/trigger_files/beam_PostCommit_Java_Avro_Versions.json b/.github/trigger_files/beam_PostCommit_Java_Avro_Versions.json
new file mode 100644
index 00000000000..1efc8e9e440
--- /dev/null
+++ b/.github/trigger_files/beam_PostCommit_Java_Avro_Versions.json
@@ -0,0 +1,4 @@
+{
+ "comment": "Modify this file in a trivial way to cause this test suite to run",
+ "modification": 1
+}
diff --git a/sdks/java/extensions/avro/src/main/java/org/apache/beam/sdk/extensions/avro/schemas/utils/AvroUtils.java b/sdks/java/extensions/avro/src/main/java/org/apache/beam/sdk/extensions/avro/schemas/utils/AvroUtils.java
index bfbab6fe87f..da7daf605d8 100644
--- a/sdks/java/extensions/avro/src/main/java/org/apache/beam/sdk/extensions/avro/schemas/utils/AvroUtils.java
+++ b/sdks/java/extensions/avro/src/main/java/org/apache/beam/sdk/extensions/avro/schemas/utils/AvroUtils.java
@@ -141,7 +141,10 @@ import org.joda.time.ReadableInstant;
*
* is used.
*/
-@SuppressWarnings({"rawtypes"})
+@SuppressWarnings({
+ "nullness", // TODO(https://github.com/apache/beam/issues/20497)
+ "rawtypes"
+})
public class AvroUtils {
private static final ForLoadedType BYTES = new ForLoadedType(byte[].class);
private static final ForLoadedType JAVA_INSTANT = new ForLoadedType(java.time.Instant.class);
@@ -484,7 +487,8 @@ public class AvroUtils {
public static org.apache.avro.Schema.Field toAvroField(Field field, String namespace) {
org.apache.avro.Schema fieldSchema =
getFieldSchema(field.getType(), field.getName(), namespace);
- return new org.apache.avro.Schema.Field(field.getName(), fieldSchema, field.getDescription());
+ return new org.apache.avro.Schema.Field(
+ field.getName(), fieldSchema, field.getDescription(), (Object) null);
}
private AvroUtils() {}