blazer 2.2.0 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of blazer might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dac159313b83f05cfa2b39da88d889b08e0089a75047a6aff43c24d735b86eb2
4
- data.tar.gz: e1d3594c4e957f04ffa575ce1aac36abf29586c275a2c402c2da5b9401356c57
3
+ metadata.gz: eedba409f17c85953be66d2b295f1857fb61de146d5c88288509440f419853e7
4
+ data.tar.gz: ad0f8f433ad5be3052eb0237f86121c6a59147b2e240fb2a41d68611e69d3022
5
5
  SHA512:
6
- metadata.gz: 05a6d614fd96a40526f0ef7bb34cf6207a48e7bcdb6495f7ea925bec919c116918ad721d388e856c388d6746033fd184eadf25ca93a4afb9c541a8ab8758f8e1
7
- data.tar.gz: 79e9087b9e4015cd866fe2b382f0bb015c104af05f9c8b1c209ce2aa06713a46436e2aa307a9901bf0d31fec861463f1224b0cc610d76e2dd5c9c12aa40a8807
6
+ metadata.gz: 8e4236c254472fb2bdc9a8cb107306d7263a11ade5b8f223cefc2363431f6f9ffeb7087d373a95823bf53112c9869871d132764232754898f8740c72ea01ceea
7
+ data.tar.gz: bb12b6473ef4702adea12a9847ef020e0f8277d9714816cbfc511262345bffbbc8aa5530a7310dd4a263f634a493286f446bc8c4db48428f6c396109b2dce474
@@ -1,3 +1,9 @@
1
+ ## 2.2.1
2
+
3
+ - Added support for Sprockets 4
4
+ - Improved Snowflake table preview
5
+ - Fixed bug with refresh link not showing
6
+
1
7
  ## 2.2.0
2
8
 
3
9
  - Added schema to table preview for Postgres and Redshift
data/README.md CHANGED
@@ -539,9 +539,7 @@ data_sources:
539
539
 
540
540
  ### Druid
541
541
 
542
- First, [enable SQL support](http://druid.io/docs/latest/querying/sql.html#configuration) on the broker.
543
-
544
- Set:
542
+ Enable [SQL support](http://druid.io/docs/latest/querying/sql.html#configuration) on the broker and set:
545
543
 
546
544
  ```yml
547
545
  data_sources:
@@ -657,13 +655,34 @@ Supports [SOQL](https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta
657
655
 
658
656
  ### Snowflake
659
657
 
660
- First, install the [ODBC driver](https://docs.snowflake.net/manuals/user-guide/odbc.html). Add [odbc_adapter](https://github.com/localytics/odbc_adapter) to your Gemfile and set:
658
+ First, install ODBC. For Homebrew, use:
659
+
660
+ ```sh
661
+ brew install unixodbc
662
+ ```
663
+
664
+ For Ubuntu, use:
665
+
666
+ ```sh
667
+ sudo apt-get install unixodbc-dev
668
+ ```
669
+
670
+ For Heroku, use the [Apt buildpack](https://github.com/heroku/heroku-buildpack-apt) and create an `Aptfile` with:
671
+
672
+ ```text
673
+ unixodbc-dev
674
+ https://sfc-repo.snowflakecomputing.com/odbc/linux/2.19.16/snowflake-odbc-2.19.16.x86_64.deb
675
+ ```
676
+
677
+ > This installs the driver at `/app/.apt/usr/lib/snowflake/odbc/lib/libSnowflake.so`
678
+
679
+ Then, download the [Snowflake ODBC driver](https://docs.snowflake.net/manuals/user-guide/odbc-download.html). Add [odbc_adapter](https://github.com/localytics/odbc_adapter) to your Gemfile and set:
661
680
 
662
681
  ```yml
663
682
  data_sources:
664
683
  my_source:
665
684
  adapter: snowflake
666
- dsn: ProductionSnowflake
685
+ conn_str: Driver=/path/to/libSnowflake.so;uid=user;pwd=password;server=host.snowflakecomputing.com
667
686
  ```
668
687
 
669
688
  ### SQLite
@@ -719,8 +738,8 @@ Blazer supports a basic permissions model.
719
738
 
720
739
  Have team members who want to learn SQL? Here are a few great, free resources.
721
740
 
722
- - [Khan Academy](https://www.khanacademy.org/computing/computer-programming/sql)
723
- - [Codecademy](https://www.codecademy.com/learn/learn-sql)
741
+ - [The Data School](https://dataschool.com/learn-sql/)
742
+ - [SQLBolt](https://sqlbolt.com/)
724
743
 
725
744
  ## Useful Tools
726
745
 
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  *= require ./bootstrap
3
- *= require ./selectize.default
3
+ *= require ./selectize
4
4
  *= require ./github
5
5
  *= require ./daterangepicker
6
6
  *= require_self
@@ -51,7 +51,7 @@
51
51
  <% words << pluralize(dashboards_count, "dashboard") if dashboards_count > 0 %>
52
52
  <% words << pluralize(checks_count, "check") if checks_count > 0 %>
53
53
  <% if words.any? %>
54
- <div class="alert alert-info" style="margin-bottom: 0;">
54
+ <div class="alert alert-info">
55
55
  Part of <%= words.to_sentence %>. Be careful when editing.
56
56
  </div>
57
57
  <% end %>
@@ -12,14 +12,14 @@
12
12
  <p class="text-muted" style="float: right;">
13
13
  <% if @cached_at %>
14
14
  Cached <%= time_ago_in_words(@cached_at, include_seconds: true) %> ago
15
- <% elsif !params[:data_source] %>
15
+ <% elsif params[:query_id] %>
16
16
  Cached just now
17
17
  <% if @data_source.cache_mode == "slow" %>
18
18
  (over <%= "%g" % @data_source.cache_slow_threshold %>s)
19
19
  <% end %>
20
20
  <% end %>
21
21
 
22
- <% if @query && !params[:data_source] %>
22
+ <% if @query && params[:query_id] %>
23
23
  <%= link_to "Refresh", refresh_query_path(@query, variable_params), method: :post %>
24
24
  <% end %>
25
25
  </p>
@@ -67,7 +67,8 @@
67
67
  <% series_library = {} %>
68
68
  <% target_index = @columns.index { |k| k.downcase == "target" } %>
69
69
  <% if target_index %>
70
- <% series_library[target_index - 1] = {pointStyle: "line", hitRadius: 5, borderColor: "#109618", pointBackgroundColor: "#109618", backgroundColor: "#109618"} %>
70
+ <% color = "#109618" %>
71
+ <% series_library[target_index - 1] = {pointStyle: "line", hitRadius: 5, borderColor: color, pointBackgroundColor: color, backgroundColor: color, pointHoverBackgroundColor: color} %>
71
72
  <% end %>
72
73
  <% if @forecast %>
73
74
  <% color = "#54a3ee" %>
@@ -32,7 +32,7 @@ module Blazer
32
32
  query_execution_id: query_execution_id
33
33
  )
34
34
  rescue Aws::Athena::Errors::InvalidRequestException => e
35
- if e.message != "Query has not yet finished. Current state: RUNNING"
35
+ unless e.message.start_with?("Query has not yet finished.")
36
36
  raise e
37
37
  end
38
38
  if Time.now < stop_at
@@ -56,6 +56,7 @@ module Blazer
56
56
  utc = ActiveSupport::TimeZone['Etc/UTC']
57
57
 
58
58
  rows = untyped_rows[1..-1] || []
59
+ rows = untyped_rows[0..-1] unless column_info.present?
59
60
  column_types.each_with_index do |ct, i|
60
61
  # TODO more column_types
61
62
  case ct
@@ -42,7 +42,7 @@ module Blazer
42
42
  def tables
43
43
  sql = add_schemas("SELECT table_schema, table_name FROM information_schema.tables")
44
44
  result = data_source.run_statement(sql, refresh_cache: true)
45
- if postgresql? || redshift?
45
+ if postgresql? || redshift? || snowflake?
46
46
  result.rows.sort_by { |r| [r[0] == default_schema ? "" : r[0], r[1]] }.map do |row|
47
47
  table =
48
48
  if row[0] == default_schema
@@ -51,6 +51,8 @@ module Blazer
51
51
  "#{row[0]}.#{row[1]}"
52
52
  end
53
53
 
54
+ table = table.downcase if snowflake?
55
+
54
56
  {
55
57
  table: table,
56
58
  value: connection_model.connection.quote_table_name(table)
@@ -148,6 +150,10 @@ module Blazer
148
150
  ["SQLServer", "tinytds", "mssql"].include?(adapter_name)
149
151
  end
150
152
 
153
+ def snowflake?
154
+ data_source.adapter == "snowflake"
155
+ end
156
+
151
157
  def adapter_name
152
158
  # prevent bad data source from taking down queries/new
153
159
  connection_model.connection.adapter_name rescue nil
@@ -172,6 +178,7 @@ module Blazer
172
178
  else
173
179
  where = "table_schema NOT IN (?)"
174
180
  schemas = ["information_schema"]
181
+ schemas.map!(&:upcase) if snowflake?
175
182
  schemas << "pg_catalog" if postgresql? || redshift?
176
183
  end
177
184
  connection_model.send(:sanitize_sql_array, ["#{query} WHERE #{where}", schemas])
@@ -3,10 +3,21 @@ module Blazer
3
3
  isolate_namespace Blazer
4
4
 
5
5
  initializer "blazer" do |app|
6
- # use a proc instead of a string
7
- app.config.assets.precompile << proc { |path| path =~ /\Ablazer\/application\.(js|css)\z/ }
8
- app.config.assets.precompile << proc { |path| path =~ /\Ablazer\/.+\.(eot|svg|ttf|woff)\z/ }
9
- app.config.assets.precompile << proc { |path| path == "blazer/favicon.png" }
6
+ if defined?(Sprockets) && Sprockets::VERSION >= "4"
7
+ app.config.assets.precompile << "blazer/application.js"
8
+ app.config.assets.precompile << "blazer/application.css"
9
+ app.config.assets.precompile << "blazer/glyphicons-halflings-regular.eot"
10
+ app.config.assets.precompile << "blazer/glyphicons-halflings-regular.svg"
11
+ app.config.assets.precompile << "blazer/glyphicons-halflings-regular.ttf"
12
+ app.config.assets.precompile << "blazer/glyphicons-halflings-regular.woff"
13
+ app.config.assets.precompile << "blazer/glyphicons-halflings-regular.woff2"
14
+ app.config.assets.precompile << "blazer/favicon.png"
15
+ else
16
+ # use a proc instead of a string
17
+ app.config.assets.precompile << proc { |path| path =~ /\Ablazer\/application\.(js|css)\z/ }
18
+ app.config.assets.precompile << proc { |path| path =~ /\Ablazer\/.+\.(eot|svg|ttf|woff|woff2)\z/ }
19
+ app.config.assets.precompile << proc { |path| path == "blazer/favicon.png" }
20
+ end
10
21
 
11
22
  Blazer.time_zone ||= Blazer.settings["time_zone"] || Time.zone
12
23
  Blazer.audit = Blazer.settings.key?("audit") ? Blazer.settings["audit"] : true
@@ -1,3 +1,3 @@
1
1
  module Blazer
2
- VERSION = "2.2.0"
2
+ VERSION = "2.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blazer
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-12 00:00:00.000000000 Z
11
+ date: 2019-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -140,7 +140,7 @@ files:
140
140
  - app/assets/stylesheets/blazer/bootstrap.css.erb
141
141
  - app/assets/stylesheets/blazer/daterangepicker.css
142
142
  - app/assets/stylesheets/blazer/github.css
143
- - app/assets/stylesheets/blazer/selectize.default.css
143
+ - app/assets/stylesheets/blazer/selectize.css
144
144
  - app/controllers/blazer/base_controller.rb
145
145
  - app/controllers/blazer/checks_controller.rb
146
146
  - app/controllers/blazer/dashboards_controller.rb
@@ -221,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
221
221
  - !ruby/object:Gem::Version
222
222
  version: '0'
223
223
  requirements: []
224
- rubygems_version: 3.0.4
224
+ rubygems_version: 3.0.3
225
225
  signing_key:
226
226
  specification_version: 4
227
227
  summary: Explore your data with SQL. Easily create charts and dashboards, and share