Skip to content

fix(semantic-layer): preserve metadata generation on unchanged configuration - #45907

Draft
mikebridge wants to merge 1 commit into
apache:masterfrom
mikebridge:sc-126724-low-batch
Draft

mikebridge wants to merge 1 commit into
apache:masterfrom
mikebridge:sc-126724-low-batch

Conversation

@mikebridge

Copy link
Copy Markdown
Contributor

SUMMARY

TL;DR: Saving an unchanged semantic-layer configuration keeps its metadata cache generation and avoids rewriting the configuration. Actual changes and explicit cache clearing still invalidate metadata.

Background: connection edits can submit the existing configuration again. Previously, simply including that field rotated the generation and discarded reusable metadata. Comparing the validated, unmasked JSON content avoids this unnecessary invalidation. Object key order and formatting are ignored; value types and list order remain significant.

An unchanged configuration is omitted from the database update as well, so a stale no-op save cannot overwrite a newer concurrent configuration. Malformed stored configuration remains repairable through an actual update.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Not applicable; backend change only.

TESTING INSTRUCTIONS

Run python -m pytest tests/unit_tests/semantic_layers/simple_cache_clear_test.py -q (41 passed). The unchanged-save and reordered-JSON regressions failed before the fix. A stale-reader regression failed against the first implementation, then passed after unchanged configuration writes were omitted. Changed-file hooks, including MyPy and pylint, pass.

ADDITIONAL INFORMATION

  • Required feature flag: SEMANTIC_LAYERS.
  • No migration or public API change.
  • Independent of the MetricFlow ordering fix; either can merge first.

…uration

Compare effective configuration content before invalidating metadata. Omit unchanged configuration writes so a stale no-op save cannot overwrite a concurrent edit without a new generation. Preserve explicit clearing and invalidation for actual changes.
@netlify

netlify Bot commented Oct 30, 2026

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit f4863c1
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6ae4f65b7976d8fc54b6e766
😎 Deploy Preview https://deploy-preview-45907--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.64%. Comparing base (e33b7d9) to head (f4863c1).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
superset/commands/semantic_layer/update.py 0.00% 7 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (e33b7d9) and HEAD (f4863c1). Click for more details.

HEAD has 3 uploads less than BASE
Flag BASE (e33b7d9) HEAD (f4863c1)
python 7 5
postgres 2 1
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #45907       +/-   ##
===========================================
- Coverage   84.73%   65.64%   -19.09%     
===========================================
  Files        3069     3069               
  Lines      205767   205787       +20     
  Branches    48388    48392        +4     
===========================================
- Hits       174350   135091    -39259     
- Misses      28123    67617    +39494     
+ Partials     3294     3079      -215     
Flag Coverage Δ
hive 34.50% <0.00%> (-0.01%) ⬇️
mysql 52.59% <0.00%> (-0.01%) ⬇️
postgres 52.60% <0.00%> (-0.01%) ⬇️
presto 36.23% <0.00%> (-0.01%) ⬇️
python 52.87% <0.00%> (-34.89%) ⬇️
sqlite 52.37% <0.00%> (-0.01%) ⬇️
unit ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant