superset 0.4.0 → 0.5.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/AGENTS.md +1 -1
- data/CHANGELOG.md +9 -0
- data/README.md +17 -0
- data/lib/superset/configuration.rb +11 -0
- data/lib/superset/dashboard/warm_up_cache.rb +3 -7
- data/lib/superset/logger.rb +2 -11
- data/lib/superset/version.rb +1 -1
- data/lib/superset.rb +30 -1
- data/superset.gemspec +0 -1
- metadata +2 -16
- data/lib/loggers/duplicate_dashboard_logger.rb +0 -15
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 59ab63d9f8d51f73e9ca6606a0a559c75def26e9c69ab09eeeb59fd91cf24447
|
|
4
|
+
data.tar.gz: c7ae83dfa2a5b5f0e100d6cce0d38e7badf04e20d174c661207223493179f851
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9f0f70518ea7bc2f9e19ba9c115bdb1c2c44f05abc0e887fcfb0de1934499847841e601ec0d5e8aabb957c368196873cad0bae6ccb300ce55fe8d9eedd3c4e29
|
|
7
|
+
data.tar.gz: 3a90c54aca065f2187bf971912dc2993f25034f6c1880fb4d973a90da3b2a1d63188871acfe64d7448abd431f27a2ea52ecc91d1c9c55194f9815016b8872b61
|
data/AGENTS.md
CHANGED
|
@@ -98,7 +98,7 @@ Common operations: `ct` (contains), `eq` (equals), `neq` (not equals), `rel_o_m`
|
|
|
98
98
|
- `response` — raw (cached) HTTP response
|
|
99
99
|
- `result` — extracts `response['result']`
|
|
100
100
|
- Constructor filter params follow naming: `title_contains:`, `title_equals:`, etc.
|
|
101
|
-
- Logging goes to `log/superset-client.log
|
|
101
|
+
- Logging goes through `Superset.logger`; by default writes to `log/superset-client.log`. Consumers can inject any `::Logger`-compatible object via `Superset.configure { |c| c.logger = your_logger }`.
|
|
102
102
|
|
|
103
103
|
### Console Helpers
|
|
104
104
|
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
## Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.0 - 2026-07-21
|
|
4
|
+
|
|
5
|
+
* Decouple from Rollbar — remove the `Rollbar.error(...) if defined?(Rollbar)` call in `WarmUpCache`; exceptions now propagate to the caller so consumers' own error handling can react
|
|
6
|
+
* Introduce configurable logger via `Superset.configure { |c| c.logger = ... }` — any object responding to `#info` and `#error` (default remains `log/superset-client.log`)
|
|
7
|
+
* **Breaking:** `Superset::Dashboard::WarmUpCache.new(...).perform` now raises on per-dataset failures instead of swallowing them; wrap the call in your own `rescue` if you need the previous silent behavior
|
|
8
|
+
* Remove unused `DuplicateDashboardLogger` module (dead code)
|
|
9
|
+
* Drop `rollbar` dev dependency; drop `require "rollbar"` from `spec_helper.rb` and `bin/console`
|
|
10
|
+
* Add explicit `require 'json'` (the gem uses `to_json` in 8+ places and was relying on rollbar to transitively load it)
|
|
11
|
+
|
|
3
12
|
## 0.4.0 - 2026-06-05
|
|
4
13
|
|
|
5
14
|
* send X-CSRFToken (and replay the session cookie) on state-changing requests so writes work against a CSRF-protected Superset
|
data/README.md
CHANGED
|
@@ -44,6 +44,23 @@ Add to your Gemfile `gem 'superset'`
|
|
|
44
44
|
And then execute: `bundle install`
|
|
45
45
|
Or install it yourself as `gem install superset`
|
|
46
46
|
|
|
47
|
+
## Configuration
|
|
48
|
+
|
|
49
|
+
The gem writes logs (dashboard duplication progress, API failures, etc.) through `Superset.logger`. By default it writes to `log/superset-client.log` relative to the working directory.
|
|
50
|
+
|
|
51
|
+
To route logs elsewhere — for example, STDOUT for a background worker, a null sink for tests, or your application's existing logger — configure it once at boot:
|
|
52
|
+
|
|
53
|
+
```ruby
|
|
54
|
+
require 'logger'
|
|
55
|
+
require 'superset'
|
|
56
|
+
|
|
57
|
+
Superset.configure do |config|
|
|
58
|
+
config.logger = ::Logger.new($stdout) # or any object responding to #info(msg) and #error(msg)
|
|
59
|
+
end
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Any object that responds to `#info(msg)` and `#error(msg)` will work — a stdlib `::Logger`, a `SemanticLogger` instance, a framework-provided logger, or a custom wrapper that forwards to your error-reporting service. The gem does not assume any particular framework.
|
|
63
|
+
|
|
47
64
|
## Run specs
|
|
48
65
|
|
|
49
66
|
```
|
|
@@ -3,7 +3,7 @@ module Superset
|
|
|
3
3
|
class WarmUpCache < Superset::Request
|
|
4
4
|
|
|
5
5
|
attr_reader :dashboard_id
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
def initialize(dashboard_id:)
|
|
8
8
|
@dashboard_id = dashboard_id
|
|
9
9
|
end
|
|
@@ -16,11 +16,7 @@ module Superset
|
|
|
16
16
|
def response
|
|
17
17
|
dataset_details = fetch_dataset_details(dashboard_id)
|
|
18
18
|
dataset_details.each do |dataset|
|
|
19
|
-
|
|
20
|
-
warm_up_dataset(dataset["datasource_name"], dataset["name"])
|
|
21
|
-
rescue => e
|
|
22
|
-
Rollbar.error("Warm up cache failed for the dashboard #{dashboard_id.to_s} and for the dataset #{dataset["datasource_name"]} - #{e}") if defined?(Rollbar)
|
|
23
|
-
end
|
|
19
|
+
warm_up_dataset(dataset["datasource_name"], dataset["name"])
|
|
24
20
|
end
|
|
25
21
|
end
|
|
26
22
|
|
|
@@ -29,7 +25,7 @@ module Superset
|
|
|
29
25
|
end
|
|
30
26
|
|
|
31
27
|
private
|
|
32
|
-
|
|
28
|
+
|
|
33
29
|
def validate_dashboard_id
|
|
34
30
|
raise InvalidParameterError, "dashboard_id must be present and must be an integer" unless dashboard_id.present? && dashboard_id.is_a?(Integer)
|
|
35
31
|
end
|
data/lib/superset/logger.rb
CHANGED
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
module Superset
|
|
2
2
|
class Logger
|
|
3
|
-
|
|
4
3
|
def info(msg)
|
|
5
|
-
|
|
6
|
-
logger.info msg
|
|
4
|
+
Superset.logger.info(msg)
|
|
7
5
|
end
|
|
8
6
|
|
|
9
7
|
def error(msg)
|
|
10
|
-
|
|
11
|
-
logger.error msg
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def logger
|
|
15
|
-
@logger ||= begin
|
|
16
|
-
::Logger.new("log/superset-client.log")
|
|
17
|
-
end
|
|
8
|
+
Superset.logger.error(msg)
|
|
18
9
|
end
|
|
19
10
|
end
|
|
20
11
|
end
|
data/lib/superset/version.rb
CHANGED
data/lib/superset.rb
CHANGED
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
require 'require_all'
|
|
4
4
|
require 'terminal-table'
|
|
5
5
|
require 'happi'
|
|
6
|
+
require 'logger'
|
|
7
|
+
require 'json'
|
|
6
8
|
|
|
9
|
+
require_relative "superset/configuration"
|
|
7
10
|
require_rel "superset/credential"
|
|
8
11
|
require_relative "superset/authenticator"
|
|
9
12
|
require_relative "superset/client"
|
|
@@ -15,5 +18,31 @@ require_rel "superset"
|
|
|
15
18
|
|
|
16
19
|
module Superset
|
|
17
20
|
class Error < StandardError; end
|
|
18
|
-
|
|
21
|
+
|
|
22
|
+
DEFAULT_LOG_PATH = "log/superset-client.log"
|
|
23
|
+
|
|
24
|
+
class << self
|
|
25
|
+
def configuration
|
|
26
|
+
@configuration ||= Configuration.new
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def configure
|
|
30
|
+
yield configuration
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def logger
|
|
34
|
+
configuration.logger || default_logger
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def reset_configuration!
|
|
38
|
+
@configuration = nil
|
|
39
|
+
@default_logger = nil
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
private
|
|
43
|
+
|
|
44
|
+
def default_logger
|
|
45
|
+
@default_logger ||= ::Logger.new(DEFAULT_LOG_PATH)
|
|
46
|
+
end
|
|
47
|
+
end
|
|
19
48
|
end
|
data/superset.gemspec
CHANGED
|
@@ -53,7 +53,6 @@ Gem::Specification.new do |spec|
|
|
|
53
53
|
spec.add_development_dependency "rspec", ">= 3.0"
|
|
54
54
|
spec.add_development_dependency "rubocop", ">= 1.0"
|
|
55
55
|
spec.add_development_dependency "pry", ">= 0.14"
|
|
56
|
-
spec.add_development_dependency "rollbar", ">= 3.0"
|
|
57
56
|
|
|
58
57
|
# For more information and examples about making a new gem, check out our
|
|
59
58
|
# guide at: https://bundler.io/guides/creating_gem.html
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: superset
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- jbat
|
|
@@ -191,20 +191,6 @@ dependencies:
|
|
|
191
191
|
- - ">="
|
|
192
192
|
- !ruby/object:Gem::Version
|
|
193
193
|
version: '0.14'
|
|
194
|
-
- !ruby/object:Gem::Dependency
|
|
195
|
-
name: rollbar
|
|
196
|
-
requirement: !ruby/object:Gem::Requirement
|
|
197
|
-
requirements:
|
|
198
|
-
- - ">="
|
|
199
|
-
- !ruby/object:Gem::Version
|
|
200
|
-
version: '3.0'
|
|
201
|
-
type: :development
|
|
202
|
-
prerelease: false
|
|
203
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
204
|
-
requirements:
|
|
205
|
-
- - ">="
|
|
206
|
-
- !ruby/object:Gem::Version
|
|
207
|
-
version: '3.0'
|
|
208
194
|
email:
|
|
209
195
|
- jonathon.batson@gmail.com
|
|
210
196
|
executables: []
|
|
@@ -230,7 +216,6 @@ files:
|
|
|
230
216
|
- docker-compose.override.yml
|
|
231
217
|
- docker-compose.yml
|
|
232
218
|
- env.sample
|
|
233
|
-
- lib/loggers/duplicate_dashboard_logger.rb
|
|
234
219
|
- lib/superset.rb
|
|
235
220
|
- lib/superset/authenticator.rb
|
|
236
221
|
- lib/superset/base_put_request.rb
|
|
@@ -243,6 +228,7 @@ files:
|
|
|
243
228
|
- lib/superset/chart/put.rb
|
|
244
229
|
- lib/superset/chart/update_dataset.rb
|
|
245
230
|
- lib/superset/client.rb
|
|
231
|
+
- lib/superset/configuration.rb
|
|
246
232
|
- lib/superset/credential/api_user.rb
|
|
247
233
|
- lib/superset/credential/embedded_user.rb
|
|
248
234
|
- lib/superset/dashboard/bulk_delete.rb
|