nexosis_api 2.2.0 → 2.3.0
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/lib/nexosis_api/client/datasets.rb +16 -1
- data/lib/nexosis_api/dataset_summary.rb +14 -0
- data/nexosisapi.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68de69240c73f21137b109d7b15c8e7cf1da75b2
|
4
|
+
data.tar.gz: 4a293eef3fb48705ab8de41588429eebcf94448c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0df0c54a56b46490157727a763a76142863f93c53cb46e2ab7c873c76a2b5a2933d8a1e04f7532a9cfb25c2958c02d7c8c25ce6a7e621102ec9685a11d2ab798
|
7
|
+
data.tar.gz: 68eecf2f181e40fb7cb6683ac1e2af3d736e270a5da4bc1c59c90f590700368da17d691d6a67cd382d7e0c0295aa91cbb3da85c0b5d3b20e853dcf30b58a5def
|
@@ -114,6 +114,20 @@ module NexosisApi
|
|
114
114
|
return if response.success?
|
115
115
|
raise HttpException.new("There was a problem removing the dataset: #{response.code}.", "removing dataset #{dataset_name}", response)
|
116
116
|
end
|
117
|
+
|
118
|
+
# Get per column statistics for data in the given dataset
|
119
|
+
# @param dataset_name [String] the name of the dataset for which to retrieve stats
|
120
|
+
# @since 2.3.0
|
121
|
+
# @note The stats will be a hash per column with a structure like: {'columns': 'column_name': { 'max': 1, 'min': 0 }}
|
122
|
+
# @note Common stats returned include 'max', 'min', 'stddev', 'variance', 'median'
|
123
|
+
def get_column_stats(dataset_name)
|
124
|
+
raise ArgumentError, 'dataset_name was not provided and is not optional ' if dataset_name.to_s.empty?
|
125
|
+
dataset_stats_url = "/data/#{dataset_name}/stats"
|
126
|
+
response = self.class.get(dataset_stats_url,
|
127
|
+
headers: @headers)
|
128
|
+
return response.parsed_response if response.success?
|
129
|
+
raise HttpException.new("There was a problem getting stats for the dataset: #{response.code}.", "getting stats for dataset #{dataset_name}", response)
|
130
|
+
end
|
117
131
|
|
118
132
|
private
|
119
133
|
|
@@ -124,7 +138,8 @@ module NexosisApi
|
|
124
138
|
headers = { 'api-key' => @api_key, 'Content-Type' => content_type }
|
125
139
|
response = self.class.put(dataset_url, headers: headers, body: content)
|
126
140
|
if response.success?
|
127
|
-
NexosisApi::DatasetSummary.new(response)
|
141
|
+
summary = NexosisApi::DatasetSummary.new(response)
|
142
|
+
summary
|
128
143
|
else
|
129
144
|
raise HttpException.new("There was a problem uploading the dataset: #{response.code}.", "uploading dataset #{dataset_name}", response)
|
130
145
|
end
|
@@ -10,6 +10,10 @@ module NexosisApi
|
|
10
10
|
.map do |col_key, col_val|
|
11
11
|
NexosisApi::Column.new(col_key, col_val)
|
12
12
|
end
|
13
|
+
elsif (k == 'dataSetSize')
|
14
|
+
@dataset_size = v.to_i
|
15
|
+
elsif (k == 'links')
|
16
|
+
@links = v.reject(&:nil?).map { |l| NexosisApi::Link.new(l) }
|
13
17
|
end
|
14
18
|
end
|
15
19
|
end
|
@@ -22,6 +26,16 @@ module NexosisApi
|
|
22
26
|
# @return [Array of NexosisApi::Column]
|
23
27
|
attr_accessor :column_metadata
|
24
28
|
|
29
|
+
# number of estimated bytes required to store the dataset
|
30
|
+
# @return [Integer]
|
31
|
+
# @since 2.3.0
|
32
|
+
attr_reader :dataset_size
|
33
|
+
|
34
|
+
# Helpful links to more information about this dataset
|
35
|
+
# @return [Array of NexosisApi::Link]
|
36
|
+
# @since 2.3.0
|
37
|
+
attr_accessor :links
|
38
|
+
|
25
39
|
# Helper method which tells you whether or not this dataset has a column with timestamp role.
|
26
40
|
# @note Often helpful for implmenters as non-timeseries datasets
|
27
41
|
# cannot be sent to forecast or impact sessions
|
data/nexosisapi.gemspec
CHANGED
@@ -16,6 +16,6 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.require_paths = ['lib']
|
17
17
|
spec.required_ruby_version = '>= 2.0.0'
|
18
18
|
spec.summary = "Ruby client for working with the Nexosis API"
|
19
|
-
spec.version = '2.
|
19
|
+
spec.version = '2.3.0'
|
20
20
|
spec.metadata["yard.run"] = "yri"
|
21
21
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nexosis_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nexosis,Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|