embulk-input-mixpanel 0.5.3 → 0.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/embulk-input-mixpanel.gemspec +1 -1
- data/lib/embulk/input/mixpanel.rb +1 -0
- data/lib/range_generator.rb +1 -1
- data/test/embulk/input/test_mixpanel.rb +7 -0
- data/test/prepare_embulk.rb +1 -2
- data/test/test_range_generator.rb +20 -0
- 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: f5341d3459ab9ebb11548c637781a2e56f8f827d
|
4
|
+
data.tar.gz: fddc31638fbfc95d804b140e91a79a880e2fd0c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ddd3e72b06554148f5bf7e866823aa3e65004ef317f7a55df269c41499515f8b23b63f4571c565bbe0123871bb1cc0d9451fc25f36939f1f5974737699152730
|
7
|
+
data.tar.gz: c59a6e927cb172562d0ecead325d4f8c5359f6bec34f672673abdf9a061b9e7aeecc617f820f99beffed30171fa038a8fa25a917f9bf82e923a49cb9a7405ac8
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
## 0.5.4 - 2017-08-15
|
2
|
+
* [bug] Fix a bug when `fetch_days` is 1 plugin will fetch 2 days instead of 1
|
3
|
+
|
1
4
|
## 0.5.3 - 2017-08-07
|
2
5
|
* [enhancement] Allow user to choose to run incremental or not `incremental` option default to true [#50](https://github.com/treasure-data/embulk-input-mixpanel/pull/50)
|
3
6
|
* [enhancement] Allow user to specify an `incremental_column`, which will be add to the where praramter is API requests[#50](https://github.com/treasure-data/embulk-input-mixpanel/pull/50)
|
data/lib/range_generator.rb
CHANGED
@@ -314,6 +314,13 @@ module Embulk
|
|
314
314
|
Mixpanel.transaction(transaction_config(days), &control)
|
315
315
|
end
|
316
316
|
|
317
|
+
def test_next_to_date
|
318
|
+
next_config_diff = Mixpanel.resume(transaction_task(1).merge(incremental: true), columns, 1) do
|
319
|
+
[{to_date: Date.today.to_s, latest_fetched_time: 1502707247000}]
|
320
|
+
end
|
321
|
+
assert_equal(Date.today.to_s, next_config_diff[:from_date])
|
322
|
+
end
|
323
|
+
|
317
324
|
def test_valid_days_with_backfill
|
318
325
|
days = 5
|
319
326
|
|
data/test/prepare_embulk.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require "embulk"
|
1
2
|
module PrepareEmbulk
|
2
3
|
if Embulk.respond_to?(:home)
|
3
4
|
# keep compatibility for Embulk 0.6.x
|
@@ -7,9 +8,7 @@ module PrepareEmbulk
|
|
7
8
|
require File.join(classpath_dir, jar)
|
8
9
|
end
|
9
10
|
require "embulk/java/bootstrap"
|
10
|
-
require "embulk"
|
11
11
|
else
|
12
|
-
require "embulk"
|
13
12
|
Embulk.setup
|
14
13
|
end
|
15
14
|
end
|
@@ -30,6 +30,26 @@ class RangeGeneratorTest < Test::Unit::TestCase
|
|
30
30
|
assert_equal(expected, actual)
|
31
31
|
end
|
32
32
|
|
33
|
+
def test_1_fetch_day
|
34
|
+
days = 1
|
35
|
+
from = "2017-08-04"
|
36
|
+
expected_from = Date.parse(from)
|
37
|
+
expected_to = Date.parse("2017-08-04")
|
38
|
+
expected = (expected_from..expected_to).to_a.map {|date| date.to_s}
|
39
|
+
actual = RangeGenerator.new(from, days).generate_range
|
40
|
+
assert_equal(expected, actual)
|
41
|
+
end
|
42
|
+
|
43
|
+
def test_5_fetch_day
|
44
|
+
days = 5
|
45
|
+
from = "2017-08-04"
|
46
|
+
expected_from = Date.parse(from)
|
47
|
+
expected_to = Date.parse("2017-08-08")
|
48
|
+
expected = (expected_from..expected_to).to_a.map {|date| date.to_s}
|
49
|
+
actual = RangeGenerator.new(from, days).generate_range
|
50
|
+
assert_equal(expected, actual)
|
51
|
+
end
|
52
|
+
|
33
53
|
class OverDaysTest < self
|
34
54
|
def setup
|
35
55
|
@from = Date.today - 5
|
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.4
|
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-08-
|
12
|
+
date: 2017-08-15 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.6.12
|
228
228
|
signing_key:
|
229
229
|
specification_version: 4
|
230
230
|
summary: Mixpanel input plugin for Embulk
|