embulk-output-mailchimp 0.3.24 → 0.3.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/build.gradle +1 -1
- data/src/main/java/org/embulk/output/mailchimp/MailChimpRecordBuffer.java +9 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94b54333acb168038a0b2537d6bf7c8a71be4993
|
4
|
+
data.tar.gz: 18b422345048fd9d9681dc24a369c8c16680c55e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8248823129afda3c947fed964e9ea6d080cf7cfb81b18d399cf9ab4aae25b40ead8e71a0981a98a9c184b018b5cc7c948b1df5aef639b35f7c03dba81ce6d7fc
|
7
|
+
data.tar.gz: 24220688ee272036fa55ce8cf040ee3c95ce76942e424a35121767bf4f8e7924985b236712ffeac1d57ef75c2ae3441ff8646e67cf63b55d5e963c5e0ec97b56
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## 0.3.25 - 2018-10-11
|
2
|
+
|
3
|
+
- Fixed an NPE when column names and merge tags are not exactly (case-sensitive) matched
|
4
|
+
|
1
5
|
## 0.3.23 - 2018-09-12
|
2
6
|
- Introduce an option to fail the job when there is an error returning from Mailchimp. Previous versions marked the job as success with
|
3
7
|
detail error in log
|
data/build.gradle
CHANGED
@@ -208,17 +208,20 @@ public class MailChimpRecordBuffer
|
|
208
208
|
|
209
209
|
// Update additional merge fields if exist
|
210
210
|
if (task.getMergeFields().isPresent() && !task.getMergeFields().get().isEmpty()) {
|
211
|
-
Map<String, String>
|
211
|
+
Map<String, String> columnNameCaseInsensitiveLookup = new TreeMap<>(CASE_INSENSITIVE_ORDER);
|
212
212
|
for (Column col : schema.getColumns()) {
|
213
|
-
|
213
|
+
columnNameCaseInsensitiveLookup.put(col.getName(), col.getName());
|
214
214
|
}
|
215
|
+
Map<String, MergeField> availableMergeFieldsCaseInsensitiveLookup = new TreeMap<>(CASE_INSENSITIVE_ORDER);
|
216
|
+
availableMergeFieldsCaseInsensitiveLookup.putAll(availableMergeFields);
|
217
|
+
|
215
218
|
for (String field : task.getMergeFields().get()) {
|
216
|
-
if (!
|
219
|
+
if (!columnNameCaseInsensitiveLookup.containsKey(field)) {
|
217
220
|
LOG.warn(format("Field '%s' is configured on data transfer but cannot be found on any columns.", field));
|
218
221
|
continue;
|
219
222
|
}
|
220
|
-
String columnName =
|
221
|
-
if (!
|
223
|
+
String columnName = columnNameCaseInsensitiveLookup.get(field);
|
224
|
+
if (!availableMergeFieldsCaseInsensitiveLookup.containsKey(columnName)) {
|
222
225
|
LOG.warn(format("Field '%s' is configured on data transfer but is not predefined on Mailchimp.", field));
|
223
226
|
continue;
|
224
227
|
}
|
@@ -226,8 +229,7 @@ public class MailChimpRecordBuffer
|
|
226
229
|
String value = input.hasNonNull(columnName) ? input.findValue(columnName).asText() : "";
|
227
230
|
|
228
231
|
// Try to convert to Json from string with the merge field's type is address
|
229
|
-
if (
|
230
|
-
.equals(MergeField.MergeFieldType.ADDRESS.getType())) {
|
232
|
+
if (availableMergeFieldsCaseInsensitiveLookup.get(columnName).getType().equals(MergeField.MergeFieldType.ADDRESS.getType())) {
|
231
233
|
JsonNode addressNode = toJsonNode(value);
|
232
234
|
if (addressNode instanceof NullNode) {
|
233
235
|
mergeFields.put(columnName.toUpperCase(), value);
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-output-mailchimp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thang Nguyen
|
@@ -89,7 +89,7 @@ files:
|
|
89
89
|
- test/override_assert_raise.rb
|
90
90
|
- test/run-test.rb
|
91
91
|
- classpath/jetty-io-9.2.14.v20151106.jar
|
92
|
-
- classpath/embulk-output-mailchimp-0.3.
|
92
|
+
- classpath/embulk-output-mailchimp-0.3.25.jar
|
93
93
|
- classpath/jetty-util-9.2.14.v20151106.jar
|
94
94
|
- classpath/jetty-http-9.2.14.v20151106.jar
|
95
95
|
- classpath/jetty-client-9.2.14.v20151106.jar
|