Repository navigation
Conversation
…ookup The inherited-RLS lookup for the dataset and datasource lists logged a WARNING with a traceback for every virtual dataset whose SQL fails to parse, on every list load. The failure is already handled (the dataset just gets no inherited RLS badge), so log it at DEBUG without a traceback.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #46139 +/- ##
==========================================
- Coverage 85.92% 85.92% -0.01%
==========================================
Files 3122 3122
Lines 216871 216871
Branches 51421 51421
==========================================
- Hits 186352 186350 -2
- Misses 27101 27102 +1
- Partials 3418 3419 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Acceptance run at d60ebf0 against a real Superset app (SQLite metadata DB, Admin and a Gamma-based viewer, two unparseable and two parseable virtual datasets):
One note on the sibling left as is: opening explore on the same unparseable dataset still logs |
rusackas
left a comment
There was a problem hiding this comment.
Thanks @aminghadersohi, nice to see the noisy traceback go away for something we already handle. LGTM!
|
Thanks @rusackas, appreciate the review. |
* origin/master: (393 commits) fix(a11y): name the semantic view description input (apache#46458) docs(semantic): explain datasource list modification eligibility (apache#46462) docs(semantic-layer): document NULL-preserving exclusion filters (apache#46447) fix(uploads): skip folder and system entries in columnar ZIP uploads (apache#45617) fix(i18n-es): promote 47 of the zero-context backfill entries (apache#45847) fix(mcp): return structured ChartError on SQLAlchemyError in get_chart_sql (apache#44351) fix(datasets): follow semantic view modification permissions (apache#46448) fix(docker): account for container memory limits in frontend-mem-nag.sh (apache#46373) fix(reports): carry the report's native filters in the email and Slack link (apache#46062) fix(explore): apply the dataset timezone to grained temporal filter values (apache#46175) fix(i18n): enforce the do-not-translate registry across the catalogs (apache#45974) chore(logging): log unparseable virtual dataset SQL at debug in the RLS lookup (apache#46139) fix(i18n): split parameter-suggestion plural into two messages (apache#46049) test(partition-mapping): cover Hive/Impala mirrored SQL, cache outage and migration (apache#46319) perf(dashboard): look up the dashboard once per filter_state read (apache#46314) fix(i18n): load the dayjs locale for every language with a catalog (apache#45982) test(semantic-layer): make date export parametrization deterministic (apache#46449) fix(oauth2): idempotent OAuth2 completion and resilient listener (apache#40292) fix(explore): prevent full table scan when SQL expression is used as x-axis (apache#41339) feat(mcp): radar chart type plugin (apache#43571) ... # Conflicts: # .github/workflows/docker.yml # .github/workflows/superset-frontend.yml
SUMMARY
DatasetDAO._parse_tables_from_virtual_datasets(used by the inherited RLS indicator on the dataset list and datasource list) loggedFailed to parse SQL for virtual datasetat WARNING with a full traceback for every virtual dataset whose SQL fails to parse, on every list load. The failure is already handled (the dataset is skipped and simply gets no inherited RLS badge), so on deployments with a few such datasets this produces thousands of warning+traceback lines per day for an expected condition.This logs it at DEBUG instead, with the dataset id and the exception message and no traceback. Behaviour is otherwise unchanged: the dataset is skipped, other datasets still get their mapping, and the API response is identical.
Sibling
logger.warning(..., exc_info=True)calls on the same path:DatasetDAO.get_rls_filters_for_dataset(theFailed to resolve inherited RLS for virtual datasetwarning) is left as is. It runs once per single-dataset request (explore / dataset get) rather than once per dataset per list load, and itstryalso wraps the RLS metadata queries, where a failure is a real error worth a WARNING with a traceback.superset/commands/explore/get.pyhas nologger.warning(..., exc_info=True)call; itsexcept Exceptionaround the RLS lookup setsrls_filters = []without logging.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A
TESTING INSTRUCTIONS
pytest tests/unit_tests/dao/dataset_rls_test.pyThe new
test_parse_tables_from_virtual_datasets_bad_sql_does_not_warnfeeds one unparseable and one parseable virtual dataset, asserts the parseable one is still mapped and that no WARNING-or-higher record is emitted. It fails on master (a WARNING record is emitted) and passes with this change.ADDITIONAL INFORMATION