embulk-input-mixpanel 0.2.1 → 0.3.0

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: 9a688fb2eb175f13ee5c82b8ea2da6c74ed69839
4
- data.tar.gz: af0fdae8cc6fba0911ab269d7d8f354d51803f25
3
+ metadata.gz: 878c5ed629d13780bfccd6b0c03e41e6c07345cf
4
+ data.tar.gz: bd30844c67525e74f702b39563a56c166b48a5e9
5
5
  SHA512:
6
- metadata.gz: 25381a19a9743a0b945d5d453931b1f93ab87009a79185b72eba32577a496550f1050b38ff8baa81c164d628a1c67714e785c27bf6833a04e69431bcad2e6ace
7
- data.tar.gz: d69d65730c8c3a3d1ea1c85182e274ea8bde716662c132ee628e1c0be7d25e2b97c0a2c15dc0a7269b714677cf1635f04fcdd8a8237ec7353714d4f1ede05094
6
+ metadata.gz: 40fe5641a663dbb10b1489e06f1dcf36ffa053bdd8495b6a0a39c1edce1e39f76264a486b3d1f8a4cc203613ed6403bae0112deb72a3c4f3d30d1ecc1d16ae92
7
+ data.tar.gz: fe18510a1491d008bd58c5abd54b6cab2dd15f9d9ad4dbbb5767306134f4e3744615e0078f5abd9df4af90d69e838e6035fe5ab9060c09f60e1731687393b90c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.3.0 - 2015-08-31
2
+
3
+ This version breaks backword compatibility of mixpanel. `days` key in config was changed to `fetch_days`. For detail, please check README.md to modify your config.
4
+
5
+ * [fixed] Fix the bug 1 day data can't be fetched [#21](https://github.com/treasure-data/embulk-input-mixpanel/pull/21)
6
+
1
7
  ## 0.2.1 - 2015-08-26
2
8
 
3
9
  * [fixed] Fix guess with recently from date [#18](https://github.com/treasure-data/embulk-input-mixpanel/pull/18)
data/README.md CHANGED
@@ -36,7 +36,7 @@ To get it, you should log in mixpanel website, and click gear icon at the lower
36
36
  - **timezone**: project timezone(string, required)
37
37
  - **from_date**: From date to export (string, optional, default: today - 2)
38
38
  - NOTE: Mixpanel API supports to export data from at least 2 days before to at most the previous day.
39
- - **days**: Count of days range for exporting (integer, optional, default: from_date - (today - 1))
39
+ - **fetch_days**: Count of days range for exporting (integer, optional, default: from_date - (today - 1))
40
40
  - NOTE: Mixpanel doesn't support to from_date > today - 2
41
41
  - **event**: The event or events to filter data (array, optional, default: nil)
42
42
  - **where**: Expression to filter data (c.f. https://mixpanel.com/docs/api-documentation/data-export-api#segmentation-expressions) (string, optional, default: nil)
@@ -51,7 +51,7 @@ in:
51
51
  api_secret: "API_SECRET"
52
52
  timezone: "US/Pacific"
53
53
  from_date: "2015-07-19"
54
- days: 5
54
+ fetch_days: 5
55
55
  ```
56
56
 
57
57
  ## Run test
@@ -1,7 +1,7 @@
1
1
 
2
2
  Gem::Specification.new do |spec|
3
3
  spec.name = "embulk-input-mixpanel"
4
- spec.version = "0.2.1"
4
+ spec.version = "0.3.0"
5
5
  spec.authors = ["yoshihara", "uu59"]
6
6
  spec.summary = "Mixpanel input plugin for Embulk"
7
7
  spec.description = "Loads records from Mixpanel."
@@ -29,7 +29,7 @@ module Embulk
29
29
  Embulk.logger.warn "Mixpanel allow 2 days before to from_date, so no data is input."
30
30
  target_dates = []
31
31
  else
32
- days = config.param(:days, :integer, default: nil)
32
+ days = config.param(:fetch_days, :integer, default: nil)
33
33
 
34
34
  if days.nil?
35
35
  # When no 'days' is specified in config file, so dates is
@@ -40,7 +40,7 @@ module Embulk
40
40
  else
41
41
  # When 'days' is specified in config file and it is satisfied,
42
42
  # so it is used for dates.
43
- dates = from_date..(from_date + days)
43
+ dates = from_date..(from_date + days - 1)
44
44
  end
45
45
 
46
46
  target_dates = dates.find_all {|date| date < Date.today}
@@ -10,7 +10,7 @@ module Embulk
10
10
  FROM_DATE = "2015-02-22".freeze
11
11
  TO_DATE = "2015-03-02".freeze
12
12
  DAYS = 8
13
- DATES = Date.parse(FROM_DATE)..(Date.parse(FROM_DATE) + DAYS)
13
+ DATES = Date.parse(FROM_DATE)..(Date.parse(FROM_DATE) + DAYS - 1)
14
14
  TIMEZONE = "Asia/Tokyo".freeze
15
15
 
16
16
  DURATIONS = [
@@ -165,7 +165,7 @@ module Embulk
165
165
 
166
166
  def test_negative_days
167
167
  assert_raise(Embulk::ConfigError) do
168
- Mixpanel.transaction(transaction_config((Date.today - 1).to_s).merge(days: -1))
168
+ Mixpanel.transaction(transaction_config((Date.today - 1).to_s).merge(fetch_days: -1))
169
169
  end
170
170
  end
171
171
 
@@ -213,7 +213,7 @@ module Embulk
213
213
  def transaction_config
214
214
  _config = config.merge(
215
215
  from_date: dates.first.to_s,
216
- days: dates.to_a.size,
216
+ fetch_days: dates.to_a.size,
217
217
  timezone: TIMEZONE,
218
218
  columns: schema
219
219
  )
@@ -279,7 +279,7 @@ module Embulk
279
279
  def transaction_task(days)
280
280
  from_date = Date.parse(FROM_DATE)
281
281
  task.merge(
282
- dates: (from_date..(from_date + days)).map {|date| date.to_s},
282
+ dates: (from_date..(from_date + days - 1)).map {|date| date.to_s},
283
283
  api_key: API_KEY,
284
284
  api_secret: API_SECRET,
285
285
  timezone: TIMEZONE,
@@ -289,7 +289,7 @@ module Embulk
289
289
 
290
290
  def transaction_config(days)
291
291
  _config = config.merge(
292
- days: days,
292
+ fetch_days: days,
293
293
  columns: schema,
294
294
  timezone: TIMEZONE,
295
295
  )
@@ -449,7 +449,7 @@ module Embulk
449
449
  api_key: API_KEY,
450
450
  api_secret: API_SECRET,
451
451
  from_date: FROM_DATE,
452
- days: DAYS,
452
+ fetch_days: DAYS,
453
453
  }
454
454
  end
455
455
 
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.2.1
4
+ version: 0.3.0
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: 2015-08-26 00:00:00.000000000 Z
12
+ date: 2015-08-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  requirement: !ruby/object:Gem::Requirement