From 0be66d4f6044820321247e44ef3fa9d2d838f302 Mon Sep 17 00:00:00 2001 From: Elizabeth Thompson Date: Sat, 20 Jun 2026 16:17:03 +0000 Subject: [PATCH] fix(schemas): rename deprecated query fields regardless of falsy values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ChartDataQueryObjectSchema.rename_deprecated_fields() used a walrus operator truthiness check (`if value := data.pop(old, None)`), which silently skipped the rename whenever the deprecated field value was falsy — most commonly timeseries_limit=0, meaning "no series limit." The old key then reached QueryObject.__init__ unchanged, triggering the _rename_deprecated_fields deprecation warning on every such chart render. Fix: check key presence (old in data) rather than value truthiness. Use setdefault so an explicit new-key value from the caller wins. Co-Authored-By: Claude Sonnet 4.6 --- superset/charts/schemas.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/superset/charts/schemas.py b/superset/charts/schemas.py index 1e514a20950e..b26f055f85c0 100644 --- a/superset/charts/schemas.py +++ b/superset/charts/schemas.py @@ -1467,8 +1467,8 @@ def rename_deprecated_fields( ("timeseries_limit_metric", "series_limit_metric"), ) for old, new in _renames: - if value := data.pop(old, None): - data[new] = value + if old in data: + data.setdefault(new, data.pop(old)) return data