embulk-input-mixpanel 0.4.5 → 0.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3c39e9af49ffa9cfcc15fe3156896652720fb72e
4
- data.tar.gz: 350093593fbd3f62c80a10071cdcb473f36203e3
3
+ metadata.gz: 29de18241b68feaf375ea8e5b75f0bf6c79063a9
4
+ data.tar.gz: 8f05066de1a870556450100082f3928b8a8655dc
5
5
  SHA512:
6
- metadata.gz: a7fe90abd0541686bb1dc4e5426a65524d93d02d4781d3f96b30d2cc8db97231302df64a11db378279a665bafeb086712d0bc3f465588f2e0bb0d9003e8cd34f
7
- data.tar.gz: 89953f9317aae738fc331f878dde1096cfa7e53f8ef869081957306cf9fec5097f10d7affe9a19e467a5f22bf91b8af72b087aa136f550f55ed1e93ff4f7bcf9
6
+ metadata.gz: c15de7628ef891132049c4f6137774bdf4315427e9e0d7c4c6cc29d8f0deaec4dad849b9985fc65c6f2214d4e3130f45460290f5d7e3bb35b53ec65596617d10
7
+ data.tar.gz: 9390d1fbe6e20e773b6ef2ef23f40a9b2922556496b597604692ce22be498776e0b00cba423b995f106ee7fb21fcdf4f719ba47a87c3800201a8af9810e0e224
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.4.6 - 2016-09-07
2
+ * [enhancement] Retry with too frequency requests error [#44](https://github.com/treasure-data/embulk-input-mixpanel/pull/44)
3
+
1
4
  ## 0.4.5 - 2016-09-05
2
5
  * [fixed] Don't try to guess future date [#43](https://github.com/treasure-data/embulk-input-mixpanel/pull/43)
3
6
 
@@ -1,7 +1,7 @@
1
1
 
2
2
  Gem::Specification.new do |spec|
3
3
  spec.name = "embulk-input-mixpanel"
4
- spec.version = "0.4.5"
4
+ spec.version = "0.4.6"
5
5
  spec.authors = ["yoshihara", "uu59"]
6
6
  spec.summary = "Mixpanel input plugin for Embulk"
7
7
  spec.description = "Loads records from Mixpanel."
@@ -131,6 +131,10 @@ module Embulk
131
131
  Embulk.logger.debug "response code: #{response.code}"
132
132
  case response.code
133
133
  when 400..499
134
+ if response.code == 429
135
+ # [429] {"error": "too many export requests in progress for this project"}
136
+ raise RuntimeError.new("[#{response.code}] #{response.body} (will retry)")
137
+ end
134
138
  raise ConfigError.new("[#{response.code}] #{response.body}")
135
139
  when 500..599
136
140
  raise RuntimeError.new("[#{response.code}] #{response.body}")
@@ -98,6 +98,15 @@ module Embulk
98
98
  end
99
99
  end
100
100
 
101
+ def test_retry_for_429_temporary_fail
102
+ stub_client
103
+ stub_response(failure_response(429))
104
+
105
+ assert_raise(RuntimeError) do
106
+ @client.export(params)
107
+ end
108
+ end
109
+
101
110
  class ExportSmallDataset < self
102
111
  def test_to_date_after_1_day
103
112
  to = (Date.parse(params["from_date"]) + 1).to_s
@@ -106,6 +115,15 @@ module Embulk
106
115
  @client.export_for_small_dataset(params)
107
116
  end
108
117
 
118
+ def test_retry_for_429_temporary_fail
119
+ stub_client
120
+ stub_response(failure_response(429))
121
+
122
+ assert_raise(RuntimeError) do
123
+ @client.export_for_small_dataset(params)
124
+ end
125
+ end
126
+
109
127
  def test_to_date_after_1_day_after_10_days_if_empty
110
128
  stub_client
111
129
  to1 = (Date.parse(params["from_date"]) + 1).to_s
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.4.5
4
+ version: 0.4.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: 2016-09-05 00:00:00.000000000 Z
12
+ date: 2016-09-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  requirement: !ruby/object:Gem::Requirement