From 2ddca22a132108be46ae682c6ae7396dd134a7b5 Mon Sep 17 00:00:00 2001 From: David Goss Date: Thu, 17 Aug 2023 09:03:04 +0100 Subject: [PATCH] tolerate null transformation attrs in field model Signed-off-by: David Goss --- .../models/ColumnLineageInputField.java | 4 +-- .../models/ColumnLineageInputField.java | 4 +-- .../models/ColumnLineageInputFieldTest.java | 25 +++++++++++++++++++ 3 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 clients/java/src/test/java/marquez/client/models/ColumnLineageInputFieldTest.java diff --git a/api/src/main/java/marquez/service/models/ColumnLineageInputField.java b/api/src/main/java/marquez/service/models/ColumnLineageInputField.java index a74cc43700..ffee7546aa 100644 --- a/api/src/main/java/marquez/service/models/ColumnLineageInputField.java +++ b/api/src/main/java/marquez/service/models/ColumnLineageInputField.java @@ -19,6 +19,6 @@ public class ColumnLineageInputField { @NotNull private String namespace; @NotNull private String dataset; @NotNull private String field; - @NotNull private String transformationDescription; - @NotNull private String transformationType; + private String transformationDescription; + private String transformationType; } diff --git a/clients/java/src/main/java/marquez/client/models/ColumnLineageInputField.java b/clients/java/src/main/java/marquez/client/models/ColumnLineageInputField.java index ea2a87cefe..acfdf47589 100644 --- a/clients/java/src/main/java/marquez/client/models/ColumnLineageInputField.java +++ b/clients/java/src/main/java/marquez/client/models/ColumnLineageInputField.java @@ -19,6 +19,6 @@ public class ColumnLineageInputField { @NonNull private String namespace; @NonNull private String dataset; @NonNull private String field; - @NonNull String transformationDescription; - @NonNull String transformationType; + private String transformationDescription; + private String transformationType; } diff --git a/clients/java/src/test/java/marquez/client/models/ColumnLineageInputFieldTest.java b/clients/java/src/test/java/marquez/client/models/ColumnLineageInputFieldTest.java new file mode 100644 index 0000000000..d688265dd8 --- /dev/null +++ b/clients/java/src/test/java/marquez/client/models/ColumnLineageInputFieldTest.java @@ -0,0 +1,25 @@ +/* + * Copyright 2018-2023 contributors to the Marquez project + * SPDX-License-Identifier: Apache-2.0 + */ + +package marquez.client.models; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; + +import org.junit.jupiter.api.Test; + +@org.junit.jupiter.api.Tag("UnitTests") +public class ColumnLineageInputFieldTest { + @Test + void testToleratesNullTransformationTypeAndDescription() { + ColumnLineageInputField field = new ColumnLineageInputField("ns", "ds", "field", null, null); + + assertEquals("ns", field.getNamespace()); + assertEquals("ds", field.getDataset()); + assertEquals("field", field.getField()); + assertNull(field.getTransformationDescription()); + assertNull(field.getTransformationType()); + } +}