This is an automated email from the ASF dual-hosted git repository. arivero pushed a commit to branch table-time-comparison-offset in repository https://gitbox.apache.org/repos/asf/superset.git
commit e6cfe8a84f13afc21df44e920228fcc3b7e74734 Author: Antonio Rivero <[email protected]> AuthorDate: Thu Apr 25 16:54:36 2024 +0200 Table with Time Comparison: - Raise if no column is passed since at least one is needed for the join (textual or temporal) --- superset/common/query_context_processor.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/superset/common/query_context_processor.py b/superset/common/query_context_processor.py index 5efa0caae0..a7f255b9f1 100644 --- a/superset/common/query_context_processor.py +++ b/superset/common/query_context_processor.py @@ -400,6 +400,11 @@ class QueryContextProcessor: metric_names = get_metric_names(query_object.metrics) join_keys = [col for col in columns if col not in metric_names] + if not join_keys: + raise QueryObjectValidationError( + _("A column must be specified when using Time Comparison.") + ) + for offset in query_object.time_offsets: try: # pylint: disable=line-too-long
