superset 0.5.1 → 0.5.3
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/CHANGELOG.md +22 -0
- data/lib/superset/client.rb +3 -3
- data/lib/superset/dashboard/import.rb +3 -1
- data/lib/superset/dashboard/list.rb +2 -0
- data/lib/superset/guest_token.rb +1 -1
- data/lib/superset/services/dashboard_loader.rb +1 -0
- data/lib/superset/version.rb +1 -1
- data/lib/superset.rb +5 -0
- metadata +55 -24
- data/.buildkite/pipeline.yml +0 -16
- data/.rspec +0 -3
- data/.rubocop.yml +0 -13
- data/.ruby-version +0 -1
- data/AGENTS.md +0 -105
- data/CLAUDE.md +0 -1
- data/Dockerfile +0 -17
- data/Rakefile +0 -12
- data/docker-compose.override.yml +0 -10
- data/docker-compose.yml +0 -8
- data/env.sample +0 -9
- data/log/README.md +0 -4
- data/superset.gemspec +0 -61
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b8b34598d228f19ee769e3381bb25efdef9104659d5fabce8109521d0344a860
|
|
4
|
+
data.tar.gz: a1f4cb502c1e6c11b1c7f965f4d185c155e9a1201398a87915087c8dc12033f4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9dd45b812b5883faf48b48fd4a111c7baacafee441cdc3da96a8da16f7ddf2a874824cdff178554509da49ae914549a53cafa1e3949909683b6ab7ef43c69174
|
|
7
|
+
data.tar.gz: abd065a21a68e4364484f226e5bf58ce78fd0619827b8b1f4ca28e3c6bfac2586c23a14ce0683b95346763b870c7e86ee6c4d57c800377202d8080709e4aa998
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
## Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.3 - 2026-09-23
|
|
4
|
+
|
|
5
|
+
* **Fix:** make the gem actually work on Faraday 2. 0.5.2 loosened the `faraday` constraint from `~> 1.10` to `>= 1.10` but adapted none of the code, so any consumer resolving Faraday 2 hit `NoMethodError: undefined method 'authorization' for an instance of Faraday::Connection` on every request through `Superset::Client` and `Superset::GuestToken`. Replaced `f.authorization :Bearer, token` with `f.request :authorization, 'Bearer', token`, which works on both Faraday 1.10+ and 2.x
|
|
6
|
+
* **Fix:** `require 'faraday/multipart'` in `Superset::Client` and `Superset::Dashboard::Import`. Faraday stopped autoloading faraday-multipart in 2.0, so `f.request :multipart` raised ":multipart is not registered on Faraday::Request"; it resolved only because happi happened to require it first — the same transitive-dependency trap as the `FaradayMiddleware::ParseJson` bug in 0.5.1. This gem declares faraday-multipart itself, so it now requires it itself
|
|
7
|
+
* Use `Faraday::Multipart::FilePart` instead of `Faraday::UploadIO` in `Dashboard::Import#payload`. Not a live break (faraday-multipart 1.x still aliases `UploadIO` to the same class once loaded), but FilePart is the maintained name and does not depend on that legacy alias
|
|
8
|
+
* Add `Dashboard::Import#payload` specs. Every existing import example stubbed `#response`, so `#payload` had never executed under test
|
|
9
|
+
* **Fix:** `require 'ostruct'` in `Dashboard::List` and `Services::DashboardLoader`. Both use `OpenStruct` but it only ever loaded transitively via activesupport <= 7.1; on activesupport 8.x the gem failed to load at all. Also declared as a gemspec dependency, since ostruct becomes a bundled gem in Ruby 3.5
|
|
10
|
+
* Stop tracking `Gemfile.lock`. This is a library; the committed lockfile pinned faraday 1.10.3 and is the direct reason the widened constraint was never exercised locally
|
|
11
|
+
* **Fix:** declare `happi` (`~> 1.0`) as a runtime dependency in the gemspec. `Superset::Client` subclasses `Happi::Client`, but happi was declared only in the `Gemfile` as a git ref — so the published gem listed no happi at all and raised `NameError` on first require for anyone installing it from a package host. happi 1.0.0 is on RubyGems and is byte-identical to the git tag this gem was developed against; the `Gemfile` git pin is now redundant and has been removed
|
|
12
|
+
* **Fix:** declare and require `activesupport` (`>= 7.1`). `lib/` calls it in ~96 places — `present?`, `blank?`, `with_indifferent_access`, `deep_symbolize_keys`, and `humanize` in `Display#table` — but the gem neither declared nor required it; it loaded only because happi depends on activesupport. Requires the four core extensions actually used rather than `active_support/all`
|
|
13
|
+
* Raise `required_ruby_version` from `>= 3` to `>= 3.2`. The old floor was never true: `Superset::Client` subclasses `Happi::Client`, and happi v1.0.0 requires ruby >= 3.2, so a bundle cannot resolve on 3.0 or 3.1. Nothing in `lib/` needs syntax newer than 3.0 — the floor is entirely happi's
|
|
14
|
+
* Make eight specs ruby-version agnostic. They hardcoded ruby 3.4's `Hash#inspect` output (`"k" => v`, not `"k"=>v`), so the suite only passed on the one ruby the strings were pasted from — leaving the declared `>= 3.2` floor untested. Expectations are now derived from the same source data the code stringifies
|
|
15
|
+
* Add `.github/workflows/ci.yml`, running the suite across ruby 3.2/3.3/3.4 and both ends of the declared faraday range (`gemfiles/faraday_1.gemfile`, `gemfiles/faraday_2.gemfile`). Buildkite already ran rspec on every PR, but against the committed `Gemfile.lock`, so CI only ever exercised faraday 1.10.3 — a single point inside the declared `>= 1.10` range, which is how 0.5.2 shipped a Faraday 2 break with a green build
|
|
16
|
+
* **Fix:** `Superset::Client#raise_error` no longer `puts` to stdout on every failed API call. A library should not write to its consumer's console, and the message is already carried by the raised exception; it now goes to `Superset.logger` (configurable since 0.5.0). The dead `binding.pry` comment beside it is gone, and `#raise_error` has specs for the first time
|
|
17
|
+
* Populate gem metadata (`homepage_uri`, `source_code_uri`, `changelog_uri`, `bug_tracker_uri`, `documentation_uri`, `rubygems_mfa_required`) — these were all commented out, so the rubygems.org page showed no links
|
|
18
|
+
* Stop shipping development scaffolding in the packaged gem. Installs previously included `Dockerfile`, `docker-compose*.yml`, `.buildkite/`, `.github/`, `gemfiles/`, `Rakefile`, `AGENTS.md`, `CLAUDE.md`, `RELEASING.md` and `env.sample`; the gem now contains `lib/`, the docs, README, CHANGELOG and LICENSE
|
|
19
|
+
|
|
20
|
+
## 0.5.2 - 2026-08-28
|
|
21
|
+
|
|
22
|
+
* Add tag-triggered release workflow (`.github/workflows/release.yml`) that publishes to RubyGems.org via OIDC trusted publishing and to GitHub Packages via the Actions `GITHUB_TOKEN` — no long-lived credentials stored anywhere. Refuses to publish unless the pushed tag's commit is reachable from `develop`. See `RELEASING.md` for the release steps and one-time RubyGems.org Trusted Publisher setup
|
|
23
|
+
* Loosen the `faraday` dependency from `~> 1.10` to `>= 1.10` so consumers aren't held back from newer Faraday releases
|
|
24
|
+
|
|
3
25
|
## 0.5.1 - 2026-08-27
|
|
4
26
|
|
|
5
27
|
* **Fix:** `Superset::Client` and `Superset::GuestToken` raised `NameError: uninitialized constant FaradayMiddleware::ParseJson` on every request. Both connections used `FaradayMiddleware::ParseJson`, but this gem has never declared or required `faraday_middleware` — the constant only reached the bundle transitively via happi, and happi 1.0.0 dropped it. Replaced with Faraday's own `f.response :json`, which is equivalent (same `content_type:` option, same `respond_to?(:to_str)` guard, same `Faraday::ParsingError` on bad bodies)
|
data/lib/superset/client.rb
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
require 'faraday/multipart'
|
|
1
2
|
require 'faraday-cookie_jar'
|
|
2
3
|
|
|
3
4
|
module Superset
|
|
@@ -48,8 +49,7 @@ module Superset
|
|
|
48
49
|
response.body
|
|
49
50
|
end
|
|
50
51
|
|
|
51
|
-
|
|
52
|
-
# binding.pry # helpfull to debug the response
|
|
52
|
+
Superset.logger.error("API Error: #{message}")
|
|
53
53
|
|
|
54
54
|
raise errors[response.status].new(message, response) # message is not being surfaced from Happi correctly, :(
|
|
55
55
|
end
|
|
@@ -75,7 +75,7 @@ module Superset
|
|
|
75
75
|
|
|
76
76
|
def connection
|
|
77
77
|
@connection ||= Faraday.new(superset_host) do |f|
|
|
78
|
-
f.authorization
|
|
78
|
+
f.request :authorization, 'Bearer', access_token
|
|
79
79
|
f.use :cookie_jar # persist the Flask session cookie across the csrf_token GET and the write
|
|
80
80
|
f.response :json, content_type: 'application/json'
|
|
81
81
|
|
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
# Superset::Dashboard::Import.new(source: '/tmp/dashboard').perform
|
|
21
21
|
#
|
|
22
22
|
|
|
23
|
+
require 'faraday/multipart'
|
|
24
|
+
|
|
23
25
|
module Superset
|
|
24
26
|
module Dashboard
|
|
25
27
|
class Import < Request
|
|
@@ -58,7 +60,7 @@ module Superset
|
|
|
58
60
|
|
|
59
61
|
def payload
|
|
60
62
|
{
|
|
61
|
-
formData: Faraday::
|
|
63
|
+
formData: Faraday::Multipart::FilePart.new(source_zip_file, "application/zip"),
|
|
62
64
|
overwrite: overwrite.to_s
|
|
63
65
|
}
|
|
64
66
|
end
|
data/lib/superset/guest_token.rb
CHANGED
|
@@ -73,7 +73,7 @@ module Superset
|
|
|
73
73
|
|
|
74
74
|
def connection
|
|
75
75
|
@connection ||= Faraday.new(authenticator.superset_host) do |f|
|
|
76
|
-
f.authorization
|
|
76
|
+
f.request :authorization, 'Bearer', access_token
|
|
77
77
|
f.use :cookie_jar # replay the Flask session cookie from the csrf_token GET on the POST
|
|
78
78
|
f.response :json, content_type: 'application/json'
|
|
79
79
|
f.request :json
|
data/lib/superset/version.rb
CHANGED
data/lib/superset.rb
CHANGED
|
@@ -6,6 +6,11 @@ require 'happi'
|
|
|
6
6
|
require 'logger'
|
|
7
7
|
require 'json'
|
|
8
8
|
|
|
9
|
+
require 'active_support/core_ext/object/blank'
|
|
10
|
+
require 'active_support/core_ext/hash/indifferent_access'
|
|
11
|
+
require 'active_support/core_ext/hash/keys'
|
|
12
|
+
require 'active_support/core_ext/string/inflections'
|
|
13
|
+
|
|
9
14
|
require_relative "superset/configuration"
|
|
10
15
|
require_rel "superset/credential"
|
|
11
16
|
require_relative "superset/authenticator"
|
metadata
CHANGED
|
@@ -1,15 +1,42 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: superset
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- jbat
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: activesupport
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '7.1'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - ">="
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '7.1'
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: happi
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - "~>"
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '1.0'
|
|
33
|
+
type: :runtime
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - "~>"
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '1.0'
|
|
13
40
|
- !ruby/object:Gem::Dependency
|
|
14
41
|
name: json
|
|
15
42
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -24,6 +51,20 @@ dependencies:
|
|
|
24
51
|
- - ">="
|
|
25
52
|
- !ruby/object:Gem::Version
|
|
26
53
|
version: '2.0'
|
|
54
|
+
- !ruby/object:Gem::Dependency
|
|
55
|
+
name: ostruct
|
|
56
|
+
requirement: !ruby/object:Gem::Requirement
|
|
57
|
+
requirements:
|
|
58
|
+
- - ">="
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: '0.5'
|
|
61
|
+
type: :runtime
|
|
62
|
+
prerelease: false
|
|
63
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
64
|
+
requirements:
|
|
65
|
+
- - ">="
|
|
66
|
+
- !ruby/object:Gem::Version
|
|
67
|
+
version: '0.5'
|
|
27
68
|
- !ruby/object:Gem::Dependency
|
|
28
69
|
name: terminal-table
|
|
29
70
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -56,14 +97,14 @@ dependencies:
|
|
|
56
97
|
name: faraday
|
|
57
98
|
requirement: !ruby/object:Gem::Requirement
|
|
58
99
|
requirements:
|
|
59
|
-
- - "
|
|
100
|
+
- - ">="
|
|
60
101
|
- !ruby/object:Gem::Version
|
|
61
102
|
version: '1.10'
|
|
62
103
|
type: :runtime
|
|
63
104
|
prerelease: false
|
|
64
105
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
106
|
requirements:
|
|
66
|
-
- - "
|
|
107
|
+
- - ">="
|
|
67
108
|
- !ruby/object:Gem::Version
|
|
68
109
|
version: '1.10'
|
|
69
110
|
- !ruby/object:Gem::Dependency
|
|
@@ -192,32 +233,20 @@ dependencies:
|
|
|
192
233
|
- - ">="
|
|
193
234
|
- !ruby/object:Gem::Version
|
|
194
235
|
version: '0.14'
|
|
195
|
-
description:
|
|
196
236
|
email:
|
|
197
237
|
- jonathon.batson@gmail.com
|
|
198
238
|
executables: []
|
|
199
239
|
extensions: []
|
|
200
240
|
extra_rdoc_files: []
|
|
201
241
|
files:
|
|
202
|
-
- ".buildkite/pipeline.yml"
|
|
203
|
-
- ".rspec"
|
|
204
|
-
- ".rubocop.yml"
|
|
205
|
-
- ".ruby-version"
|
|
206
|
-
- AGENTS.md
|
|
207
242
|
- CHANGELOG.md
|
|
208
|
-
- CLAUDE.md
|
|
209
|
-
- Dockerfile
|
|
210
243
|
- LICENSE
|
|
211
244
|
- README.md
|
|
212
|
-
- Rakefile
|
|
213
245
|
- doc/duplicate_dashboards.md
|
|
214
246
|
- doc/migrating_dashboards_across_environments.md
|
|
215
247
|
- doc/publishing.md
|
|
216
248
|
- doc/setting_up_personal_api_credentials.md
|
|
217
249
|
- doc/usage.md
|
|
218
|
-
- docker-compose.override.yml
|
|
219
|
-
- docker-compose.yml
|
|
220
|
-
- env.sample
|
|
221
250
|
- lib/superset.rb
|
|
222
251
|
- lib/superset/authenticator.rb
|
|
223
252
|
- lib/superset/base_put_request.rb
|
|
@@ -291,13 +320,16 @@ files:
|
|
|
291
320
|
- lib/superset/tag/get.rb
|
|
292
321
|
- lib/superset/tag/list.rb
|
|
293
322
|
- lib/superset/version.rb
|
|
294
|
-
- log/README.md
|
|
295
|
-
- superset.gemspec
|
|
296
323
|
homepage: https://github.com/rdytech/superset-client
|
|
297
324
|
licenses:
|
|
298
325
|
- MIT
|
|
299
|
-
metadata:
|
|
300
|
-
|
|
326
|
+
metadata:
|
|
327
|
+
homepage_uri: https://github.com/rdytech/superset-client
|
|
328
|
+
source_code_uri: https://github.com/rdytech/superset-client/tree/develop
|
|
329
|
+
changelog_uri: https://github.com/rdytech/superset-client/blob/develop/CHANGELOG.md
|
|
330
|
+
bug_tracker_uri: https://github.com/rdytech/superset-client/issues
|
|
331
|
+
documentation_uri: https://github.com/rdytech/superset-client/blob/develop/README.md
|
|
332
|
+
rubygems_mfa_required: 'true'
|
|
301
333
|
rdoc_options: []
|
|
302
334
|
require_paths:
|
|
303
335
|
- lib
|
|
@@ -305,15 +337,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
305
337
|
requirements:
|
|
306
338
|
- - ">="
|
|
307
339
|
- !ruby/object:Gem::Version
|
|
308
|
-
version: '3'
|
|
340
|
+
version: '3.2'
|
|
309
341
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
310
342
|
requirements:
|
|
311
343
|
- - ">="
|
|
312
344
|
- !ruby/object:Gem::Version
|
|
313
345
|
version: '0'
|
|
314
346
|
requirements: []
|
|
315
|
-
rubygems_version: 3.
|
|
316
|
-
signing_key:
|
|
347
|
+
rubygems_version: 3.6.9
|
|
317
348
|
specification_version: 4
|
|
318
349
|
summary: A Ruby Client for Apache Superset API
|
|
319
350
|
test_files: []
|
data/.buildkite/pipeline.yml
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
steps:
|
|
2
|
-
- label: ":rspec:"
|
|
3
|
-
command: bin/setup && bundle exec rspec
|
|
4
|
-
plugins:
|
|
5
|
-
docker-compose#v3.0.3:
|
|
6
|
-
run: app
|
|
7
|
-
volumes:
|
|
8
|
-
- ./coverage:/app/coverage
|
|
9
|
-
- ./log:/app/log
|
|
10
|
-
timeout: 10
|
|
11
|
-
agents:
|
|
12
|
-
queue: docker-heavy
|
|
13
|
-
artifact_paths:
|
|
14
|
-
- "coverage/.resultset*.json"
|
|
15
|
-
- "log/*.log"
|
|
16
|
-
- "log/*.xml"
|
data/.rspec
DELETED
data/.rubocop.yml
DELETED
data/.ruby-version
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
3.4.4
|
data/AGENTS.md
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
# Agents
|
|
2
|
-
|
|
3
|
-
This file provides guidance to AI coding agents working with code in this repository.
|
|
4
|
-
|
|
5
|
-
## Commands
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
# Install dependencies
|
|
9
|
-
bundle install
|
|
10
|
-
|
|
11
|
-
# Open interactive console (auto-loads .env)
|
|
12
|
-
bin/console
|
|
13
|
-
|
|
14
|
-
# Run full test suite
|
|
15
|
-
rspec
|
|
16
|
-
|
|
17
|
-
# Run a single test file
|
|
18
|
-
rspec spec/path/to/test_spec.rb
|
|
19
|
-
|
|
20
|
-
# Run a single test by line number
|
|
21
|
-
rspec spec/path/to/test_spec.rb:42
|
|
22
|
-
|
|
23
|
-
# Lint
|
|
24
|
-
rubocop
|
|
25
|
-
|
|
26
|
-
# Run specs + rubocop together
|
|
27
|
-
rake
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
Docker equivalents: prefix commands with `docker-compose run --rm app`.
|
|
31
|
-
|
|
32
|
-
### Environment Setup
|
|
33
|
-
|
|
34
|
-
Copy `env.sample` to `.env` and fill in:
|
|
35
|
-
- `SUPERSET_HOST` — API base URL (required)
|
|
36
|
-
- `SUPERSET_API_USERNAME` / `SUPERSET_API_PASSWORD` — API credentials (required)
|
|
37
|
-
- `SUPERSET_ENVIRONMENT` — optional; loads `.env-{ENVIRONMENT}` instead
|
|
38
|
-
- `CONSOLE_TIMEOUT` — seconds before auto-logout in console (default 1800)
|
|
39
|
-
|
|
40
|
-
## Architecture
|
|
41
|
-
|
|
42
|
-
### Request Framework
|
|
43
|
-
|
|
44
|
-
All API interactions inherit from `Superset::Request` (`lib/superset/request.rb`). Subclasses implement:
|
|
45
|
-
- `route` — returns the API path (e.g., `"dashboard/#{id}"`)
|
|
46
|
-
- `filters` — returns a filter query string or `""`
|
|
47
|
-
- `list_attributes` — array of field names used for terminal table display
|
|
48
|
-
|
|
49
|
-
**Patterns by HTTP verb:**
|
|
50
|
-
- **GET/LIST** — inherit `Superset::Request`, implement `route` and `filters`
|
|
51
|
-
- **PUT** — inherit `Superset::BasePutRequest`, takes `target_id:` and `params:`, implement `route`
|
|
52
|
-
- **DELETE/POST** — call `client.delete(route)` or `client.post(route, params)` directly
|
|
53
|
-
|
|
54
|
-
Pagination is built into `Superset::Request` (default page size: 100, max: 1000). List classes accept `page_num:` and `page_size:` kwargs.
|
|
55
|
-
|
|
56
|
-
### Authentication Flow
|
|
57
|
-
|
|
58
|
-
1. `Superset::Client` (extends `Happi::Client`) includes `Credential::ApiUser` and creates a `Superset::Authenticator`
|
|
59
|
-
2. `Authenticator` POSTs to `api/v1/security/login` and extracts `access_token`
|
|
60
|
-
3. `Client#connection` builds a Faraday connection with Bearer token; supports both JSON and multipart modes (`config.use_json`)
|
|
61
|
-
|
|
62
|
-
### Query Filter Syntax
|
|
63
|
-
|
|
64
|
-
Superset uses an ORM-like filter string format:
|
|
65
|
-
```
|
|
66
|
-
filters:!((col:column_name,opr:operation,value:value)),
|
|
67
|
-
```
|
|
68
|
-
Common operations: `ct` (contains), `eq` (equals), `neq` (not equals), `rel_o_m`, `rel_m_m`, `dashboard_tags`.
|
|
69
|
-
|
|
70
|
-
### Service Layer
|
|
71
|
-
|
|
72
|
-
`lib/superset/services/` contains complex multi-step workflows. The main one is `DuplicateDashboard`, which:
|
|
73
|
-
1. Validates source/target IDs, schema existence, and data sovereignty rules (all chart datasets must share the same DB schema)
|
|
74
|
-
2. Copies the dashboard and its charts
|
|
75
|
-
3. Duplicates datasets pointing to the target schema
|
|
76
|
-
4. Rewires chart JSON metadata and filter configs to the new dataset IDs
|
|
77
|
-
5. Optionally sets embedded config, tags, and publishes
|
|
78
|
-
6. **Rolls back all created objects on failure**
|
|
79
|
-
|
|
80
|
-
`ImportDashboardAcrossEnvironment` handles cross-environment migration via export/import ZIP files.
|
|
81
|
-
|
|
82
|
-
### Display Mixin
|
|
83
|
-
|
|
84
|
-
`Superset::Display` (`lib/superset/display.rb`) is included in `Superset::Request` and provides `list`, `rows`, `to_h`, and `ids`. Requires `list_attributes` and `result` to be implemented by the subclass.
|
|
85
|
-
|
|
86
|
-
### Resource–Relationship Model
|
|
87
|
-
|
|
88
|
-
- **Dashboards** contain **Charts**
|
|
89
|
-
- **Charts** reference **Datasets** (datasources)
|
|
90
|
-
- **Dashboard JSON metadata** stores layout, chart positions, and filter configurations
|
|
91
|
-
- **Filters** reference Datasets for filter values
|
|
92
|
-
- Duplication/migration requires updating all these cross-references
|
|
93
|
-
|
|
94
|
-
### Conventions
|
|
95
|
-
|
|
96
|
-
- Namespace: `Superset::<ResourceType>::<Action>` (e.g., `Superset::Dashboard::List`)
|
|
97
|
-
- `perform` — executes a state-changing action, returns `self`
|
|
98
|
-
- `response` — raw (cached) HTTP response
|
|
99
|
-
- `result` — extracts `response['result']`
|
|
100
|
-
- Constructor filter params follow naming: `title_contains:`, `title_equals:`, etc.
|
|
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
|
-
|
|
103
|
-
### Console Helpers
|
|
104
|
-
|
|
105
|
-
In `bin/console`: `sshelp` (alias: `superset_class_list`) lists all available `Superset::` classes. On startup, `Superset::Database::List.call` prints available DB connections.
|
data/CLAUDE.md
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
See [AGENTS.md](AGENTS.md) for project context and development instructions.
|
data/Dockerfile
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# 1: Use ruby 3.4.4 as base:
|
|
2
|
-
FROM ruby:3.4.4
|
|
3
|
-
|
|
4
|
-
RUN apt-get update && \
|
|
5
|
-
apt-get install -y --no-install-recommends \
|
|
6
|
-
build-essential
|
|
7
|
-
|
|
8
|
-
ENV BUNDLER_VERSION='2.4.22'
|
|
9
|
-
RUN gem install bundler -v ${BUNDLER_VERSION}
|
|
10
|
-
|
|
11
|
-
# 2: We'll set the application path as the working directory
|
|
12
|
-
WORKDIR /app
|
|
13
|
-
|
|
14
|
-
# 3: We'll add the app's binaries path to $PATH:
|
|
15
|
-
ENV PATH=$PATH:/app/bin
|
|
16
|
-
|
|
17
|
-
ENV BUNDLE_GITHUB__HTTPS=true BUNDLE_MAJOR_DEPRECATIONS=true
|
data/Rakefile
DELETED
data/docker-compose.override.yml
DELETED
data/docker-compose.yml
DELETED
data/env.sample
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
SUPERSET_HOST="http://localhost:8080/"
|
|
2
|
-
|
|
3
|
-
# general api calls
|
|
4
|
-
SUPERSET_API_USERNAME="USERNAME"
|
|
5
|
-
SUPERSET_API_PASSWORD="PASSWORD"
|
|
6
|
-
|
|
7
|
-
# embedded user guest token api calls
|
|
8
|
-
# SUPERSET_EMBEDDED_USERNAME="EMBEDDED-USERNAME"
|
|
9
|
-
# SUPERSET_EMBEDDED_PASSWORD="EMBEDDED-PASSWORD"
|
data/log/README.md
DELETED
data/superset.gemspec
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require_relative "lib/superset/version"
|
|
4
|
-
|
|
5
|
-
Gem::Specification.new do |spec|
|
|
6
|
-
spec.name = "superset"
|
|
7
|
-
spec.version = Superset::VERSION
|
|
8
|
-
spec.authors = ["jbat"]
|
|
9
|
-
spec.email = ["jonathon.batson@gmail.com"]
|
|
10
|
-
|
|
11
|
-
spec.summary = "A Ruby Client for Apache Superset API"
|
|
12
|
-
spec.homepage = "https://github.com/rdytech/superset-client"
|
|
13
|
-
spec.license = "MIT"
|
|
14
|
-
spec.required_ruby_version = ">= 3"
|
|
15
|
-
|
|
16
|
-
#spec.metadata["allowed_push_host"] = ""
|
|
17
|
-
|
|
18
|
-
#spec.metadata["homepage_uri"] = spec.homepage
|
|
19
|
-
#spec.metadata["source_code_uri"] = ""
|
|
20
|
-
#spec.metadata["changelog_uri"] = ""
|
|
21
|
-
|
|
22
|
-
# Specify which files should be added to the gem when it is released.
|
|
23
|
-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
24
|
-
spec.files = Dir.chdir(__dir__) do
|
|
25
|
-
`git ls-files -z`.split("\x0").reject do |f|
|
|
26
|
-
(File.expand_path(f) == __FILE__) ||
|
|
27
|
-
f.start_with?(*%w[bin/ test/ spec/ features/ .git appveyor Gemfile])
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
#spec.bindir = "exe"
|
|
32
|
-
#spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
|
33
|
-
spec.require_paths = [
|
|
34
|
-
"lib"
|
|
35
|
-
]
|
|
36
|
-
|
|
37
|
-
spec.add_dependency "json", ">= 2.0"
|
|
38
|
-
spec.add_dependency "terminal-table", "~> 4.0"
|
|
39
|
-
spec.add_dependency "require_all", ">= 3.0"
|
|
40
|
-
# >= 1.10 because the connections use Faraday's own `f.response :json`
|
|
41
|
-
# (Faraday::Response::Json), which only ships from 1.10.
|
|
42
|
-
spec.add_dependency "faraday", "~> 1.10"
|
|
43
|
-
spec.add_dependency "faraday-multipart", "~> 1.0"
|
|
44
|
-
spec.add_dependency "faraday-cookie_jar", "~> 0.0.7" # replay the Flask session cookie for CSRF
|
|
45
|
-
spec.add_dependency "enumerate_it", ">= 1.7"
|
|
46
|
-
|
|
47
|
-
# rubyzip is only needed by the dashboard import/export feature, which lazily
|
|
48
|
-
# `require 'zip'` at call time. Kept as a dev dependency so those specs run here,
|
|
49
|
-
# but NOT a runtime dependency — consumers that don't import/export (embedders,
|
|
50
|
-
# read/write API clients) shouldn't inherit its rubyzip >= 3 pin.
|
|
51
|
-
# Apps that DO use import/export must declare rubyzip (>= 3.0) themselves.
|
|
52
|
-
spec.add_development_dependency "rubyzip", ">= 3.0"
|
|
53
|
-
spec.add_development_dependency "dotenv", ">= 2.0"
|
|
54
|
-
spec.add_development_dependency "rake", ">= 13.0"
|
|
55
|
-
spec.add_development_dependency "rspec", ">= 3.0"
|
|
56
|
-
spec.add_development_dependency "rubocop", ">= 1.0"
|
|
57
|
-
spec.add_development_dependency "pry", ">= 0.14"
|
|
58
|
-
|
|
59
|
-
# For more information and examples about making a new gem, check out our
|
|
60
|
-
# guide at: https://bundler.io/guides/creating_gem.html
|
|
61
|
-
end
|