aleph_analytics 0.4.1 → 0.4.2

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: 7e1db8aa9b5d9683d749e21595c0f3060311cf4e
4
- data.tar.gz: 6e0f9d737de278e1cc20bfb93b8390f24f142879
3
+ metadata.gz: 8bf0f1fc5b43a93ae8232cef7a809e5087a4937b
4
+ data.tar.gz: 877a6cb72c1f2134d9a0e940c24439a4cebfaa42
5
5
  SHA512:
6
- metadata.gz: 1bfcbc8ed2830c89b53d21ba77db6a877981f72f1224cd01dfdf6bdb60e44b1ca249a42a247c3835e5bc249e931fbd3fb5d8e2c304da078604dba0d92c88a30f
7
- data.tar.gz: 6ea247ebd88fcc9aa83ab22fc2ae7c6283c0a79aa7fd429d74f6154eacf9828e549d418ac7f9a418ff626da5019410958c0cb252f56e64744c5e9179e0ee2b1d
6
+ metadata.gz: e80ad98b3161bc1c212353a830a543fd26d38a931524988a639cba93e8addd3c0456e3f2ed68153b36ee7154e8e1799872bd0b833212ee4ecde29cca746baf32
7
+ data.tar.gz: 6c03a869a3fb02f6d6c26a15e4c15203d5d636d6cc04499e41756345460aafc43668a948111d14ebbaaef28d0b67f7d39895c7f0105f831a59a587a239f13c4a
@@ -1,6 +1,10 @@
1
1
  # Change Log
2
2
  All notable changes to this project will be documented in this file using [Semantic Versioning](http://semver.org/).
3
3
 
4
+ ## [0.4.2] - 2019-09-25
5
+ ### Fixed
6
+ - [Error when Snowflake query returns empty result set](https://github.com/lumoslabs/aleph/issues/91)
7
+
4
8
  ## [0.4.1] - 2019-09-10
5
9
  ### Fixed
6
10
  - [Bug fixes for v0.4.0](https://github.com/lumoslabs/aleph/pull/89)
@@ -23,7 +27,7 @@ All notable changes to this project will be documented in this file using [Seman
23
27
  - [Site wide, saved filter for schema](https://github.com/lumoslabs/aleph/issues/38)
24
28
 
25
29
  ### Fixed
26
- - [Use trusty for travis](https://github.com/lumoslabs/aleph/issues/67)
30
+ - [Use trusty for travis](https://github.com/lumoslabs/al eph/issues/67)
27
31
  - [Display 24-hour format](https://github.com/lumoslabs/aleph/issues/53)
28
32
  - [Schema search should be able to handle numbers](https://github.com/lumoslabs/aleph/issues/59)
29
33
  - [Clean up /tmp result files when query fails](https://github.com/lumoslabs/aleph/issues/37)
@@ -31,8 +35,7 @@ All notable changes to this project will be documented in this file using [Seman
31
35
 
32
36
  ## [0.1.0] - 2017-04-27
33
37
  ### Features
34
- - [Auto-complete on dot](https://github.com/lumoslabs/aleph/issues/48)
35
-
38
+ - [Auto-complete on dot](https://github.com/lumoslabs/aleph/issues/48)auser
36
39
  ### Fixed
37
40
  - [change retry configuration for schema query](https://github.com/lumoslabs/aleph/issues/46)
38
41
 
@@ -73,9 +73,16 @@ EOF
73
73
  location = File.join(connection.unload_target, result.current_result_filename)
74
74
  sql = SNOWFLAKE_UNLOAD_SQL % {location: location, query: body, max_file_size: connection.max_file_size}
75
75
  row = connection.connection.fetch(sql).first
76
- row_count = row[:rows_unloaded]
76
+ row_count = row[:rows_unloaded].to_i
77
77
 
78
- headers, samples = CsvSerializer.load_from_s3_file(result.current_result_s3_key, NUM_SAMPLE_ROWS)
78
+ if row_count.zero?
79
+ # snowflake unload does not create a file if query returns empty result set; create an empty file
80
+ headers = ['']
81
+ samples = []
82
+ ResultCsvGenerator.new(result.id, headers, true)
83
+ else
84
+ headers, samples = CsvSerializer.load_from_s3_file(result.current_result_s3_key, NUM_SAMPLE_ROWS)
85
+ end
79
86
 
80
87
  result.headers = headers
81
88
  result.save!
@@ -3,10 +3,15 @@ require 'csv'
3
3
  class ResultCsvGenerator
4
4
  attr_accessor :csv
5
5
 
6
- def initialize(result_id, headers)
6
+ def initialize(result_id, headers, create_empty = false)
7
7
  @result_id = result_id
8
8
  @headers = headers
9
9
  @csv_service = CsvService.new(@result_id)
10
+
11
+ if create_empty
12
+ setup_csv.call()
13
+ finish_csv.call(0)
14
+ end
10
15
  end
11
16
 
12
17
  def callbacks
metadata CHANGED
@@ -1,15 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aleph_analytics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Xue
8
8
  - Rob Froetscher
9
+ - Joyce Lau
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2019-09-10 00:00:00.000000000 Z
13
+ date: 2019-09-25 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: bundler
@@ -41,7 +42,7 @@ dependencies:
41
42
  version: '1.6'
42
43
  description: The best way to develop and share queries/investigations/results within
43
44
  an analytics team
44
- email: andrew@lumoslabs.com
45
+ email: eng-data@lumoslabs.com
45
46
  executables:
46
47
  - aleph
47
48
  extensions: []
@@ -364,7 +365,7 @@ files:
364
365
  - public/422.html
365
366
  - public/500.html
366
367
  - public/aleph.png
367
- - public/assets/.sprockets-manifest-4a69de18b234914e05f19cc97d022868.json
368
+ - public/assets/.sprockets-manifest-e90c0c4662c0c76f7810002edc0efab9.json
368
369
  - public/assets/FontAwesome-9ccfa32dd4cd1b8e83f68899d85bd5e6.otf
369
370
  - public/assets/ZeroClipboard-8b5c117b88fe37e32fd34a70fdf60026.swf
370
371
  - public/assets/angular/aleph.js-4356bfc80f5b7dd3a9c9fdfacc6c8e7b.es6