embulk-input-mixpanel 0.5.5 → 0.5.6
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 +4 -4
- data/CHANGELOG.md +6 -0
- data/embulk-input-mixpanel.gemspec +1 -1
- data/lib/embulk/input/mixpanel.rb +4 -3
- data/test/embulk/input/test_mixpanel.rb +22 -10
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4244a94a3544327e669c32d73c2ccee585995447
|
4
|
+
data.tar.gz: 626163f5745eb15632ba40f53322a406e1aa2281
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d5261a04ea1ec237282956ffd68423974ba3e84858a77e4fd7b86f4f86984453111e60d0671ad539131ebf435da160793fad7389f0e134652b4d19618de91f5
|
7
|
+
data.tar.gz: 4a427ea5b7f21463b6fc608afb9dc9d39d6ff1cd94383aabee10d7f89205fd43f87e611d2de1df2653e0afd869527b7866d9552e77d2a3562fa7c56ef5a7ef46
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## 0.5.6 - 2017-09-20
|
2
|
+
* [bug] Fix issue when back_fill data get processed by Mixpanel when plugin is running [#54](https://github.com/treasure-data/embulk-input-mixpanel/pull/54)
|
3
|
+
|
4
|
+
## 0.5.5 - 2017-09-11
|
5
|
+
* [enhancement] Add slice_range configuration [#52](https://github.com/treasure-data/embulk-input-mixpanel/pull/52)
|
6
|
+
|
1
7
|
## 0.5.4 - 2017-08-15
|
2
8
|
* [bug] Fix a bug when `fetch_days` is 1 plugin will fetch 2 days instead of 1 [#51](https://github.com/treasure-data/embulk-input-mixpanel/pull/51)
|
3
9
|
|
@@ -159,13 +159,13 @@ module Embulk
|
|
159
159
|
prev_latest_fetched_time = task[:latest_fetched_time] || 0
|
160
160
|
prev_latest_fetched_time_format = Time.at(prev_latest_fetched_time).strftime("%F %T %z")
|
161
161
|
current_latest_fetched_time = prev_latest_fetched_time
|
162
|
-
@dates.each_slice(task[:slice_range]) do |
|
162
|
+
@dates.each_slice(task[:slice_range]) do |sliced_dates|
|
163
163
|
ignored_record_count = 0
|
164
164
|
unless preview?
|
165
|
-
Embulk.logger.info "Fetching data from #{dates.first} to #{
|
165
|
+
Embulk.logger.info "Fetching data from #{@dates.first} to #{sliced_dates.last} ..."
|
166
166
|
end
|
167
167
|
record_time_column=@incremental_column || DEFAULT_TIME_COLUMN
|
168
|
-
fetch(dates, prev_latest_fetched_time).each do |record|
|
168
|
+
fetch([@dates.first, sliced_dates.last], prev_latest_fetched_time).each do |record|
|
169
169
|
if @incremental
|
170
170
|
if !record["properties"].include?(record_time_column)
|
171
171
|
raise Embulk::ConfigError.new("Incremental column not exists in fetched data #{record_time_column}")
|
@@ -193,6 +193,7 @@ module Embulk
|
|
193
193
|
end
|
194
194
|
page_builder.add(values)
|
195
195
|
end
|
196
|
+
prev_latest_fetched_time = [current_latest_fetched_time, prev_latest_fetched_time].max
|
196
197
|
if ignored_record_count > 0
|
197
198
|
Embulk.logger.warn "Skipped already loaded #{ignored_record_count} records. These record times are older or equal than previous fetched record time (#{prev_latest_fetched_time} @ #{prev_latest_fetched_time_format})."
|
198
199
|
end
|
@@ -571,7 +571,7 @@ module Embulk
|
|
571
571
|
|
572
572
|
def test_run
|
573
573
|
stub(@plugin).preview? { false }
|
574
|
-
mock(@page_builder).add(anything).times(records.length
|
574
|
+
mock(@page_builder).add(anything).times(records.length)
|
575
575
|
mock(@page_builder).finish
|
576
576
|
|
577
577
|
@plugin.run
|
@@ -580,7 +580,7 @@ module Embulk
|
|
580
580
|
def test_timezone
|
581
581
|
stub(@plugin).preview? { false }
|
582
582
|
adjusted = record_epoch - timezone_offset_seconds
|
583
|
-
mock(@page_builder).add(["FOO", adjusted, "event"]).times(records.length
|
583
|
+
mock(@page_builder).add(["FOO", adjusted, "event"]).times(records.length)
|
584
584
|
mock(@page_builder).finish
|
585
585
|
|
586
586
|
@plugin.run
|
@@ -592,9 +592,9 @@ module Embulk
|
|
592
592
|
plugin = Mixpanel.new(task.merge(slice_range: 2), nil, nil, @page_builder)
|
593
593
|
stub(plugin).preview? {false}
|
594
594
|
stub(plugin).fetch(["2015-02-22", "2015-02-23"],0){[]}
|
595
|
-
stub(plugin).fetch(["2015-02-
|
596
|
-
stub(plugin).fetch(["2015-02-
|
597
|
-
stub(plugin).fetch(["2015-02-
|
595
|
+
stub(plugin).fetch(["2015-02-22", "2015-02-25"],0){[]}
|
596
|
+
stub(plugin).fetch(["2015-02-22", "2015-02-27"],0){[]}
|
597
|
+
stub(plugin).fetch(["2015-02-22", "2015-03-01"],0){[]}
|
598
598
|
mock(@page_builder).finish
|
599
599
|
plugin.run
|
600
600
|
end
|
@@ -644,8 +644,14 @@ module Embulk
|
|
644
644
|
mock(page_builder).add(["FOO", adjusted, "event"]).times(records.length * 2)
|
645
645
|
mock(page_builder).finish
|
646
646
|
any_instance_of(MixpanelApi::Client) do |klass|
|
647
|
-
stub(klass).export(
|
648
|
-
|
647
|
+
stub(klass).export(satisfy{|params|
|
648
|
+
'(abc==def) and properties["mp_processing_time_ms"] > 1'==params["where"]
|
649
|
+
}).once do |params, block|
|
650
|
+
records.each{|record| block.call(record) }
|
651
|
+
end
|
652
|
+
stub(klass).export(satisfy{|params|
|
653
|
+
'(abc==def) and properties["mp_processing_time_ms"] > 1234567919'==params["where"]
|
654
|
+
}).once do |params, block|
|
649
655
|
records.each{|record| block.call(record) }
|
650
656
|
end
|
651
657
|
end
|
@@ -661,8 +667,14 @@ module Embulk
|
|
661
667
|
mock(page_builder).add(["FOO", adjusted, "event"]).times(records.length * 2)
|
662
668
|
mock(page_builder).finish
|
663
669
|
any_instance_of(MixpanelApi::Client) do |klass|
|
664
|
-
stub(klass).export(
|
665
|
-
|
670
|
+
stub(klass).export(satisfy {|params|
|
671
|
+
'properties["mp_processing_time_ms"] > 1'==params["where"]
|
672
|
+
}).once() do |params,block|
|
673
|
+
records.each{|record| block.call(record) }
|
674
|
+
end
|
675
|
+
stub(klass).export(satisfy {|params|
|
676
|
+
'properties["mp_processing_time_ms"] > 1234567919' == params["where"]
|
677
|
+
}).once() do |params,block|
|
666
678
|
records.each{|record| block.call(record) }
|
667
679
|
end
|
668
680
|
end
|
@@ -770,7 +782,7 @@ module Embulk
|
|
770
782
|
{"int" => properties["int"], "event" => record["event"]}.to_json
|
771
783
|
]
|
772
784
|
|
773
|
-
mock(@page_builder).add(added).times(records.length
|
785
|
+
mock(@page_builder).add(added).times(records.length)
|
774
786
|
mock(@page_builder).finish
|
775
787
|
|
776
788
|
@plugin.run
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-input-mixpanel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yoshihara
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-09-
|
12
|
+
date: 2017-09-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -224,7 +224,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
224
224
|
version: '0'
|
225
225
|
requirements: []
|
226
226
|
rubyforge_project:
|
227
|
-
rubygems_version: 2.
|
227
|
+
rubygems_version: 2.4.8
|
228
228
|
signing_key:
|
229
229
|
specification_version: 4
|
230
230
|
summary: Mixpanel input plugin for Embulk
|