You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by el...@apache.org on 2026/07/02 22:07:13 UTC

(superset) branch fix/query-object-schema-rename-falsy created (now d2b6561e202)

This is an automated email from the ASF dual-hosted git repository.

eschutho pushed a change to branch fix/query-object-schema-rename-falsy
in repository https://gitbox.apache.org/repos/asf/superset.git


      at d2b6561e202 fix(schemas): preserve groupby-overwrites-columns semantics while still handling falsy values

This branch includes the following new commits:

     new d2b6561e202 fix(schemas): preserve groupby-overwrites-columns semantics while still handling falsy values

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(superset) 01/01: fix(schemas): preserve groupby-overwrites-columns semantics while still handling falsy values

Posted by el...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

eschutho pushed a commit to branch fix/query-object-schema-rename-falsy
in repository https://gitbox.apache.org/repos/asf/superset.git

commit d2b6561e2026e07ebcad1431c44f3cda05520be7
Author: Elizabeth Thompson <es...@gmail.com>
AuthorDate: Thu Jul 2 22:06:59 2026 +0000

    fix(schemas): preserve groupby-overwrites-columns semantics while still handling falsy values
    
    The setdefault-based rename in the prior commit fixed the falsy-value bug
    (timeseries_limit=0) but changed the groupby->columns merge behavior: it
    now preserves an existing `columns` value instead of letting `groupby`
    overwrite it, which regressed test_time_offset_comparison_queries_use_chart_row_limit
    and its sibling (both rely on groupby overwriting columns) and
    test_chart_data_query_object_schema_deprecated_fields_renamed's
    "groupby overwrites columns when both are provided" case.
    
    Restore the overwrite semantics for all four renames, but treat 0 as a
    meaningful value (not just non-empty/non-None) so timeseries_limit=0
    still renames to series_limit=0 - fixing the original falsy-pop bug
    without touching the overwrite behavior other tests depend on.
---
 superset/charts/schemas.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/superset/charts/schemas.py b/superset/charts/schemas.py
index b26f055f85c..69348df64a4 100644
--- a/superset/charts/schemas.py
+++ b/superset/charts/schemas.py
@@ -1467,8 +1467,9 @@ class ChartDataQueryObjectSchema(Schema):
             ("timeseries_limit_metric", "series_limit_metric"),
         )
         for old, new in _renames:
-            if old in data:
-                data.setdefault(new, data.pop(old))
+            value = data.pop(old, None)
+            if value or value == 0:
+                data[new] = value
         return data