michael-s-molina commented on code in PR #24176:
URL: https://github.com/apache/superset/pull/24176#discussion_r1214443954


##########
superset/common/query_context_processor.py:
##########
@@ -444,10 +467,48 @@ def processing_time_offsets(  # pylint: 
disable=too-many-locals,too-many-stateme
                 datasource_uid=query_context.datasource.uid,
                 region=CacheRegion.DATA,
             )
-            rv_dfs.append(offset_slice)
+            offset_dfs.append(offset_metrics_df)
+
+        if offset_dfs:
+            # iterate on offset_dfs, left join each with df
+            for offset_df in offset_dfs:
+                df = dataframe_utils.left_join_df(
+                    left_df=df,
+                    right_df=offset_df,
+                    join_keys=join_keys,
+                    rsuffix="_right",
+                )
+
+        # remove AGGREGATED_JOIN_COLUMN from df
+        if use_aggregated_join_column:
+            df.drop(columns=[AGGREGATED_JOIN_COLUMN], inplace=True)
 
-        rv_df = pd.concat(rv_dfs, axis=1, copy=False) if time_offsets else df
-        return CachedTimeOffset(df=rv_df, queries=queries, 
cache_keys=cache_keys)
+        return CachedTimeOffset(df=df, queries=queries, cache_keys=cache_keys)
+
+    @staticmethod
+    def get_aggregated_join_column(
+        row: pd.Series, column_index: int, time_grain: str

Review Comment:
   `TimeGrain` is a `string` because we have some configurations defined as 
strings and changing them would constitute breaking changes and the window is 
already closed.
   
   ```
   TIME_GRAIN_DENYLIST: list[str] = []
   TIME_GRAIN_ADDONS: dict[str, str] = {}
   TIME_GRAIN_ADDON_EXPRESSIONS: dict[str, dict[str, str]] = {}
   ```



-- 
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]

Reply via email to