embulk-input-google_analytics 0.1.10 → 0.1.11

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: d129766efe1174a97720a2c9f1d20d41ceade3a9
4
- data.tar.gz: 20760966f3ec891bd9ed63230a3fd22c85fa36fb
3
+ metadata.gz: 4908cb8c2ef90afb6fd836fa2729d7de9f1f37fb
4
+ data.tar.gz: 67f19b97cc1ab3563f4b153a22d5c25edde47c74
5
5
  SHA512:
6
- metadata.gz: de1f2ef838245c407ad699ae49803f5991f51b7e1912adcd78339f030a1060728fa69e99cca40b17d13c5ce2c8972274ae49d30f84b6028059c5ebab474a7d5a
7
- data.tar.gz: cd42caf65d6b2a8f7bc98e23d5b5bb22b393b4795b4d16089094f68f39a7794b845f6d9b14bd75f38d58881c556709cee1fbd578fe591db80af5d6ad70c2d6e4
6
+ metadata.gz: 07fc22f6be977ddcbe3a1d4f93f10870ff3c1a507de41725398bc9272bdbb5461b7dc22ff8642b274cda1b4489ec2ce366db89ea6a0ef5c15482083fe0f1aa03
7
+ data.tar.gz: e5ee6478f1f5a950e26b59bb7d331e7f1e26b428e748ac9e119d2b8a17e1e3a8f04ecc3942a66a45882e8bcebc2cb846eb22c70509babb91a77c7c2b6302d34b
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- jruby-9.0.4.0
1
+ jruby-9.1.5.0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.1.11 - 2017-01-16
2
+ * Throw DataError if '(other)' values appear as ga:dateHour as ga:date or ga:dateHour [#18](https://github.com/treasure-data/embulk-input-google_analytics/pull/18)
3
+
1
4
  ## 0.1.10 - 2016-12-08
2
5
  * Logging unexpected time string [#17](https://github.com/treasure-data/embulk-input-google_analytics/pull/17)
3
6
 
data/circle.yml CHANGED
@@ -2,7 +2,7 @@ machine:
2
2
  java:
3
3
  version: oraclejdk8
4
4
  ruby:
5
- version: jruby-9.0.4.0
5
+ version: jruby-9.1.5.0
6
6
  environment:
7
7
  JRUBY_OPTS: "-Xcli.debug=true --debug"
8
8
 
@@ -1,7 +1,7 @@
1
1
 
2
2
  Gem::Specification.new do |spec|
3
3
  spec.name = "embulk-input-google_analytics"
4
- spec.version = "0.1.10"
4
+ spec.version = "0.1.11"
5
5
  spec.authors = ["uu59"]
6
6
  spec.summary = "Google Analytics input plugin for Embulk"
7
7
  spec.description = "Loads records from Google Analytics."
@@ -52,6 +52,7 @@ module Embulk
52
52
  met = metrics.zip(row[:metrics].first[:values]).to_h
53
53
  format_row = dim.merge(met)
54
54
  raw_time = format_row[task["time_series"]]
55
+ optimize_value_by_query_limit?(raw_time)
55
56
  next if too_early_data?(raw_time)
56
57
  format_row[task["time_series"]] = time_parse_with_profile_timezone(raw_time)
57
58
  format_row["view_id"] = view_id
@@ -92,6 +93,14 @@ module Embulk
92
93
  end
93
94
  end
94
95
 
96
+ def optimize_value_by_query_limit?(data)
97
+ # For any date range, Analytics returns a maximum of 1 million rows for the report. Rows in excess of 1 million are rolled-up into an (other) row.
98
+ # See more details: https://support.google.com/analytics/answer/1009671
99
+ if data.to_s == "(other)"
100
+ raise Embulk::DataError.new('Stop fetching data from Analytics because over 1M data fetching was limited. Please reduce data range to fetch data according to this article: https://support.google.com/analytics/answer/1009671.')
101
+ end
102
+ end
103
+
95
104
  def time_parse_with_profile_timezone(time_string)
96
105
  date_format =
97
106
  case task["time_series"]
data/test/run-test.rb CHANGED
@@ -13,13 +13,8 @@ $LOAD_PATH.unshift(test_dir)
13
13
  ENV["TEST_UNIT_MAX_DIFF_TARGET_STRING_SIZE"] ||= "5000"
14
14
 
15
15
  if ENV["COVERAGE"]
16
- if ENV["CI"]
17
- require "codeclimate-test-reporter"
18
- CodeClimate::TestReporter.start
19
- else
20
- require 'simplecov'
21
- SimpleCov.start 'test_frameworks'
22
- end
16
+ require 'simplecov'
17
+ SimpleCov.start 'test_frameworks'
23
18
  end
24
19
 
25
20
  exit Test::Unit::AutoRunner.run(true, test_dir)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-input-google_analytics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - uu59
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-08 00:00:00.000000000 Z
11
+ date: 2017-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -253,7 +253,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
253
253
  version: '0'
254
254
  requirements: []
255
255
  rubyforge_project:
256
- rubygems_version: 2.4.8
256
+ rubygems_version: 2.6.6
257
257
  signing_key:
258
258
  specification_version: 4
259
259
  summary: Google Analytics input plugin for Embulk