ffernandez92 commented on code in PR #28865:
URL: https://github.com/apache/beam/pull/28865#discussion_r1349483028
##########
sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaReadSchemaTransformConfiguration.java:
##########
@@ -48,8 +48,14 @@ public void validate() {
assert startOffset == null ||
VALID_START_OFFSET_VALUES.contains(startOffset)
: "Valid Kafka Start offset values are " + VALID_START_OFFSET_VALUES;
final String dataFormat = this.getFormat();
- assert dataFormat == null || VALID_DATA_FORMATS.contains(dataFormat)
- : "Valid data formats are " + VALID_DATA_FORMATS;
+ assert dataFormat == null || isValidDataFormat(dataFormat)
+ : "Valid data formats are " + VALID_FORMATS_STR;
+ }
+
+ private boolean isValidDataFormat(String dataFormat) {
+ // Convert the input dataFormat to lowercase for case-insensitive
comparison
+ String lowercaseDataFormat = dataFormat.toLowerCase();
+ return VALID_DATA_FORMATS.contains(lowercaseDataFormat);
Review Comment:
Well, I actually considered that too. But, you know, I'm not entirely sure
if someone else might be using it through the expansion service. So, my thought
was to make it compatible with older versions and not cause any disruptions.
That's why I went for the case-insensitive approach.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]