Commit Graph

9 Commits

Author SHA1 Message Date
Evan Rusackas
1800a72f3b address review: align query_cancelation with diagnose()
diagnose() in lib.py only counts cancel_query being overridden OR
has_implicit_cancel() returning True (equivalent, statically, to
overriding has_implicit_cancel since the base returns False). The
extractor additionally counted get_cancel_query_id, which could mark
cancellation as supported even when cancel_query wasn't overridden.
Removed get_cancel_query_id from CAP_METHODS and the query_cancelation
check so the generated docs match diagnose().

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-22 19:26:43 -07:00
Evan Rusackas
ebab0327a2 address review: preserve existing JSON for unresolvable cap flags
Cap attrs assigned via expressions (e.g. DruidEngineSpec.allows_joins =
is_feature_enabled("DRUID_JOINS")) can't be statically evaluated, so
they previously silently fell back to the BaseEngineSpec default —
causing generated docs to disagree with runtime behavior.

Now the Python extractor tracks unresolvable assignments per class,
propagates them through the MRO walk, and emits an
_unresolved_cap_fields marker on the database entry. The JS layer
uses that marker to prefer the value from the previously-generated
databases.json (which was produced with Flask context and reflects
real runtime values) and strips the marker before writing output.

Verified against druid.py: extraction correctly emits
"_unresolved_cap_fields": ["joins"], and the existing JSON's
"joins": false is preserved rather than overwritten with the base
default of true.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-22 19:26:07 -07:00
Evan Rusackas
ff37592986 address review: iterate bases right-to-left so leftmost wins (MRO)
Python attribute lookup picks the first base that defines the attr; the
previous left-to-right update() order caused later bases to override
earlier ones, contradicting MRO. Reversing the iteration makes the
leftmost base the final writer, which matches Python semantics for the
common single-chain hierarchies in db_engine_specs.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-22 19:22:11 -07:00
Superset Dev
12d6b2f5b7 fix(docs): read capability flags from engine specs in database docs generator
Update the database docs generator to extract capability flag values
directly from Python engine spec class attributes (supports_catalog,
supports_dynamic_schema, etc.) and method overrides (cancel_query,
estimate_statement_cost, impersonate_user, has_implicit_cancel, etc.)
using AST parsing in the fallback path.

Previously the generator hardcoded False for all capability flags and
relied on mergeWithExistingDiagnostics to preserve manual edits from
the existing databases.json. This made it impossible to keep flags
in sync with the Python source.

Changes:
- Fallback AST path now extracts cap flags via AST with proper
  inheritance resolution (mirrors lib.py has_custom_method logic)
- mergeWithExistingDiagnostics now only preserves score/max_score/
  time_grains (Flask-context-only fields), not capability flags
- lib.py generate_yaml_docs now includes supports_dynamic_catalog
  in its output, and skips base specs that would overwrite a real
  product spec's flags for the same engine_name
- Regenerated databases.json with corrected flag values

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 17:10:40 -07:00
Evan Rusackas
ef4b1d674b feat(docs): add filterable UI Components table and improve build performance (#38253)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 10:32:25 -03:00
Evan Rusackas
6589ee48f9 docs: bifurcate documentation into user and admin sections (#38196)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-26 13:29:08 -08:00
Evan Rusackas
f6f9e083ac fix(docs): replace identicon logos and deduplicate README database wall (#37500)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 12:33:36 -08:00
Evan Rusackas
b7a5b24a54 feat(docs): add auto-generated troubleshooting section to database pages (#37345)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 14:43:02 -08:00
Evan Rusackas
b460ca94c6 feat(docs): auto-generate database documentation from lib.py (#36805)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 10:54:01 -08:00