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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7bd2a4db83fe03e54434449187716447a8c7ce7b
4
- data.tar.gz: 3b3385ab55f592b937b38a4cfac2f2c5d62ad548
3
+ metadata.gz: 94b54333acb168038a0b2537d6bf7c8a71be4993
4
+ data.tar.gz: 18b422345048fd9d9681dc24a369c8c16680c55e
5
5
  SHA512:
6
- metadata.gz: 727ddd4c581d69b5b34962d73a3d8a54e2e4365ee98b7ddd13df84b04b6c8222adcc101673056c74c113ba061d654034dd7fea4b4dfe1e48e148ddbeaa2b1c2b
7
- data.tar.gz: ecd1e9229bb8015e28eea7a5dbedb70e7997b28fb74d78ab3cdafbf4e2790ff6f7f22a0523ace0e710cf873f4bdf2166db9d59a79ae1b77cd50cd933459c6bcf
6
+ metadata.gz: 8248823129afda3c947fed964e9ea6d080cf7cfb81b18d399cf9ab4aae25b40ead8e71a0981a98a9c184b018b5cc7c948b1df5aef639b35f7c03dba81ce6d7fc
7
+ data.tar.gz: 24220688ee272036fa55ce8cf040ee3c95ce76942e424a35121767bf4f8e7924985b236712ffeac1d57ef75c2ae3441ff8646e67cf63b55d5e963c5e0ec97b56
@@ -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
@@ -18,7 +18,7 @@ configurations {
18
18
  provided
19
19
  }
20
20
 
21
- version = "0.3.24"
21
+ version = "0.3.25"
22
22
 
23
23
  sourceCompatibility = 1.7
24
24
  targetCompatibility = 1.7
@@ -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> columnNameLookup = new TreeMap<>(CASE_INSENSITIVE_ORDER);
211
+ Map<String, String> columnNameCaseInsensitiveLookup = new TreeMap<>(CASE_INSENSITIVE_ORDER);
212
212
  for (Column col : schema.getColumns()) {
213
- columnNameLookup.put(col.getName(), col.getName());
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 (!columnNameLookup.containsKey(field)) {
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 = columnNameLookup.get(field);
221
- if (!availableMergeFields.containsKey(columnName.toLowerCase())) {
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 (availableMergeFields.get(columnName).getType()
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.24
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.24.jar
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