robdiciuccio commented on a change in pull request #13138:
URL: https://github.com/apache/superset/pull/13138#discussion_r577981468
##########
File path: superset/utils/core.py
##########
@@ -1579,3 +1580,34 @@ def format_list(items: Sequence[str], sep: str = ", ",
quote: str = '"') -> str:
def find_duplicates(items: Iterable[InputType]) -> List[InputType]:
"""Find duplicate items in an iterable."""
return [item for item, count in collections.Counter(items).items() if
count > 1]
+
+
+def normalize_dttm_col(
+ df: pd.DataFrame,
+ timestamp_format: Optional[str],
+ offset: int,
+ time_shift: Optional[timedelta],
+) -> pd.DataFrame:
+ if DTTM_ALIAS not in df.columns:
+ return df
+ df = df.copy()
Review comment:
Is the `copy` operation necessary here? This could be very expensive on
memory for large result sets.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]