embulk-input-marketo 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3f71b3f65dab9d932934f09d2c5e9b47f9702613
4
- data.tar.gz: d951b2cd6e46bedbbdf2f7ea4c25803c3f470d20
3
+ metadata.gz: 17a277c0df4feaded10161dcf1ed102720aec4e4
4
+ data.tar.gz: a80c7582a7c4fdd2becd1e4c34ae612b7379d7c7
5
5
  SHA512:
6
- metadata.gz: dd33daed69356a087369dee73c6381dea6e61488227f5aaff52f705168241a97011bb77ed5c6b35ede7dbb3352dfcb03e7c206612f9b9b75dfb5d6ca81727c40
7
- data.tar.gz: 02c17f9f3d72b8586a9479bed842b24fa2f2205a82b5a05b535ed291df84bf3b385a0e2d9638da3a924061e97b72db9533a47dd304466b9ebff65ac805772af7
6
+ metadata.gz: c613c70701ccc188deac206d407954804632353ab1fe11fd79bdf1294426e5cbc42b19a7b021d28345cfb93f810e6a7701163d65c6ec2604742fc3beafc9635b
7
+ data.tar.gz: af31cd4811d5e8bd3bb3e54977d52e80e295d7770fd7f3b3d0929a7ebe777d455d24714c6ef60f9b8d91e64f710911eb3acf22b03bd2b766247cca28fb6aabec
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.2.2 - 2015-09-08
2
+
3
+ * [fixed] Fix handling for activity_date_time [#32](https://github.com/treasure-data/embulk-input-marketo/pull/32)
4
+
1
5
  ## 0.2.1 - 2015-09-01
2
6
 
3
7
  * [fixed] activity_log: Avoid to cast values unexpectedly [#29](https://github.com/treasure-data/embulk-input-marketo/pull/29)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "embulk-input-marketo"
3
- spec.version = "0.2.1"
3
+ spec.version = "0.2.2"
4
4
  spec.authors = ["uu59", "yoshihara"]
5
5
  spec.summary = "Marketo input plugin for Embulk"
6
6
  spec.description = "Loads records from Marketo."
@@ -39,7 +39,7 @@ module Embulk
39
39
  value = activity_log[name]
40
40
  next unless value
41
41
 
42
- case column["type"]
42
+ case column["type"].to_s
43
43
  when "timestamp"
44
44
  Time.parse(value)
45
45
  else
@@ -69,8 +69,7 @@ module Embulk
69
69
  activities.each do |activity|
70
70
  record = {
71
71
  "id" => activity[:id],
72
- # embulk can't treat DateTime
73
- "activity_date_time" => Time.parse(activity[:activity_date_time]),
72
+ "activity_date_time" => activity[:activity_date_time],
74
73
  "activity_type" => activity[:activity_type],
75
74
  "mktg_asset_name" => activity[:mktg_asset_name],
76
75
  "mkt_person_id" => activity[:mkt_person_id],
@@ -31,7 +31,7 @@ module ActivityLogFixtures
31
31
  remaining_count: "1",
32
32
  new_start_position: {
33
33
  latest_created_at: true,
34
- oldest_created_at: "2015-07-14T00:13:13+00:00",
34
+ oldest_created_at: "2015-07-14T00:13:13+0000",
35
35
  activity_created_at: true,
36
36
  offset: offset,
37
37
  },
@@ -39,7 +39,7 @@ module ActivityLogFixtures
39
39
  lead_change_record: [
40
40
  {
41
41
  id: "1",
42
- activity_date_time: "2015-07-14T00:00:09+00:00",
42
+ activity_date_time: "2015-07-14T00:00:09+0000",
43
43
  activity_type: "at1",
44
44
  mktg_asset_name: "score1",
45
45
  activity_attributes: {
@@ -60,7 +60,7 @@ module ActivityLogFixtures
60
60
  },
61
61
  {
62
62
  id: "2",
63
- activity_date_time: "2015-07-14T00:00:10+00:00",
63
+ activity_date_time: "2015-07-14T00:00:10+0000",
64
64
  activity_type: "at2",
65
65
  mktg_asset_name: "score2",
66
66
  activity_attributes: {
@@ -98,7 +98,7 @@ module ActivityLogFixtures
98
98
  lead_change_record: [
99
99
  {
100
100
  id: "3",
101
- activity_date_time: "2015-07-14T00:00:11+00:00",
101
+ activity_date_time: "2015-07-14T00:00:11+0000",
102
102
  activity_type: "at3",
103
103
  mktg_asset_name: "score3",
104
104
  activity_attributes: {
@@ -126,7 +126,7 @@ module ActivityLogFixtures
126
126
  records = (1..15).map do |i|
127
127
  {
128
128
  id: i,
129
- activity_date_time: "2015-07-14T00:00:11+00:00",
129
+ activity_date_time: "2015-07-14T00:00:11+0000",
130
130
  activity_type: "at#{i}",
131
131
  mktg_asset_name: "score#{i}",
132
132
  activity_attributes: {
@@ -102,9 +102,9 @@ module Embulk
102
102
  end
103
103
  end
104
104
 
105
- mock(@page_builder).add(["1", Time.parse("2015-07-14 09:00:09 +0900"), "at1", "score1", "100", "Attribute1", "402"])
106
- mock(@page_builder).add(["2", Time.parse("2015-07-14 09:00:10 +0900"), "at2", "score2", "90", "Attribute2", "403"])
107
- mock(@page_builder).add(["3", Time.parse("2015-07-14 09:00:11 +0900"), "at3", "score3", "100", "Attribute3", "404"])
105
+ mock(@page_builder).add(["1", Time.parse("2015-07-14T00:00:09+0000"), "at1", "score1", "100", "Attribute1", "402"])
106
+ mock(@page_builder).add(["2", Time.parse("2015-07-14T00:00:10+0000"), "at2", "score2", "90", "Attribute2", "403"])
107
+ mock(@page_builder).add(["3", Time.parse("2015-07-14T00:00:11+0000"), "at3", "score3", "100", "Attribute3", "404"])
108
108
  mock(@page_builder).finish
109
109
 
110
110
  @plugin.run
@@ -134,7 +134,7 @@ module Embulk
134
134
  end
135
135
 
136
136
  1.upto(ActivityLog::PREVIEW_COUNT) do |count|
137
- mock(@page_builder).add([count, Time.parse("2015-07-14 09:00:11 +0900"), "at#{count}", "score#{count}", "100", "Attribute#{count}", "404"])
137
+ mock(@page_builder).add([count, Time.parse("2015-07-14T00:00:11+0000"), "at#{count}", "score#{count}", "100", "Attribute#{count}", "404"])
138
138
  end
139
139
  mock(@page_builder).finish
140
140
 
@@ -89,7 +89,7 @@ module Embulk
89
89
  def schema
90
90
  metadata = [
91
91
  {index: 0, name: "id", type: :long},
92
- {index: 1, name: "activity_date_time", type: :timestamp, format: "%Y-%m-%d %H:%M:%S %z"},
92
+ {index: 1, name: "activity_date_time", type: :timestamp, format: "%Y-%m-%dT%H:%M:%S%z"}, # NOTE: `format` is the same as-is response (e.g. "2015-07-14T00:00:11+0000" to "%Y-%m-%dT%H:%M:%S%z")
93
93
  {index: 2, name: "activity_type", type: :string},
94
94
  {index: 3, name: "mktg_asset_name", type: :string},
95
95
  {index: 4, name: "mkt_person_id", type: :long},
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-input-marketo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - uu59
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-09-01 00:00:00.000000000 Z
12
+ date: 2015-09-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  requirement: !ruby/object:Gem::Requirement