embulk-input-google_analytics 0.1.10 → 0.1.11
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/.ruby-version +1 -1
- data/CHANGELOG.md +3 -0
- data/circle.yml +1 -1
- data/embulk-input-google_analytics.gemspec +1 -1
- data/lib/embulk/input/google_analytics/client.rb +9 -0
- data/test/run-test.rb +2 -7
- 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: 4908cb8c2ef90afb6fd836fa2729d7de9f1f37fb
|
4
|
+
data.tar.gz: 67f19b97cc1ab3563f4b153a22d5c25edde47c74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07fc22f6be977ddcbe3a1d4f93f10870ff3c1a507de41725398bc9272bdbb5461b7dc22ff8642b274cda1b4489ec2ce366db89ea6a0ef5c15482083fe0f1aa03
|
7
|
+
data.tar.gz: e5ee6478f1f5a950e26b59bb7d331e7f1e26b428e748ac9e119d2b8a17e1e3a8f04ecc3942a66a45882e8bcebc2cb846eb22c70509babb91a77c7c2b6302d34b
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
jruby-9.
|
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
@@ -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.
|
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
|
-
|
17
|
-
|
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.
|
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:
|
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.
|
256
|
+
rubygems_version: 2.6.6
|
257
257
|
signing_key:
|
258
258
|
specification_version: 4
|
259
259
|
summary: Google Analytics input plugin for Embulk
|