Skip to content

Apache Superset

3 fixes in apache/superset, maintained by Apache Software Foundation.

Back to all open-source fixes

About Apache Superset

Apache Superset is an open-source data exploration and visualization platform. It connects to dozens of SQL databases through per-engine “engine specs”, lets users build charts and dashboards without writing code, and supports Jinja templating in virtual datasets for dynamic SQL. It is used as a BI platform by organizations of every size.

My work on it

My Superset work is about making charts tell the truth. Most of it is in the database engine specs, the layer that translates Superset’s time grains into each database’s SQL dialect, where I fixed how weekly charts group dates on Hive, Oracle, and Impala. I also fixed Jinja templating so dashboard filters with a value of 0 or false aren’t silently dropped. I verified engine behavior against real databases rather than relying only on mocks, and added CI coverage so the fixes can’t regress unnoticed.

Correct weekly bucketing on Hive, with real-database CI coverage

The problem. Hive’s Week time grain subtracted the wrong number of days from each date, so every weekday landed in a different bucket. Weekly charts on Hive showed a point roughly every two days, each holding a partial total, and no test covered the expression.

The fix. Corrected the expression so every date truncates to the Monday of its week. After review, I followed up by adding an integration test that runs the shipped expression against a live Hive instance in CI, without creating tables or writing to HDFS, and skips cleanly on the other database jobs.

How I tested it. Unit tests pin the expression and evaluate it with stand-ins for the Hive functions. I also ran it on a live Hive 2.3.2 across date and timestamp columns, and the CI test fails if the old expression is ever reintroduced.

Keeping 0 and false filter values in Jinja templates

The problem. The get_filters() and filter_values() Jinja macros used a truthiness check, so any filter whose value was 0 or false was silently skipped. The most common case was a dashboard Range filter starting at 0: selecting 0–100 only passed the upper bound to the template, and the template and outer query disagreed about which filters applied.

The fix. Replaced the truthiness checks with explicit checks for missing or empty values, so 0 and false are kept while filters without a usable value behave exactly as before.

How I tested it. The full Jinja context test suite passes, and tests for the 0, false, and Range-filter cases fail before the change and pass after it.

Fixed Monday week start for Oracle and Impala

The problem. Oracle and Impala truncated weeks to “the same weekday as January 1st” rather than a fixed day. The week start shifted every year, each year ended with a one- or two-day stub week, and weeks never crossed a year boundary, which broke week-over-week comparisons around New Year.

The fix. Switched Oracle to ISO weeks, which always start on Monday regardless of locale settings. Impala doesn’t support ISO weeks, so I read the Impala source to find the truncation unit that maps to the previous Monday. I also flagged that existing weekly charts would regroup so maintainers could decide how to communicate it.

How I tested it. Compared before and after on a live Oracle 23ai instance and added regression tests for both engines.