eschutho opened a new pull request, #41286: URL: https://github.com/apache/superset/pull/41286
## Summary **Deprecation warning found in production Datadog:** `Superset.explore_json This API endpoint is deprecated and will be removed in version 5.0.0` This message fired on **every** HTTP request to any endpoint decorated with `@deprecated` in `views/base.py`. The `explore_json` endpoint — still used by legacy chart types with `useLegacyApi: true` — was generating this warning thousands of times per day, making the log signal meaningless and adding noise to Datadog. **What changed:** - Added a `_warned = False` closure variable inside `_deprecated` (one flag per decorated endpoint, allocated at decoration time). - The warning now fires exactly **once per endpoint per worker process** on the first call to that endpoint. - Subsequent requests to the same deprecated endpoint are handled silently. - Message text and format are unchanged. **No behavior change:** the endpoint continues to respond normally on every request. Only the repeated log line is suppressed. **Thread safety:** the first-call race on multi-threaded workers is benign — at worst two or three log lines on startup, then silence. No lock needed. ## Test plan - [ ] Verify `explore_json` deprecation warning appears exactly once in logs after a gunicorn worker starts (not on every request) - [ ] Verify the endpoint itself still returns correct responses (no logic change) - [ ] Run existing integration tests: `pytest tests/integration_tests/core_tests.py -k explore_json` - [ ] Confirm no existing tests assert the warning fires on every request (none exist: `grep -rn "deprecated.*Warning" tests/` returns no hits for `views/base`) 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
