dpgaspar commented on a change in pull request #9427: feat: Add post processing
to QueryObject
URL:
https://github.com/apache/incubator-superset/pull/9427#discussion_r405383097
##########
File path: superset/common/query_object.py
##########
@@ -138,9 +145,36 @@ def cache_key(self, **extra: Any) -> str:
if self.time_range:
cache_dict["time_range"] = self.time_range
json_data = self.json_dumps(cache_dict, sort_keys=True)
+ if self.post_processing:
+ cache_dict["post_processing"] = self.post_processing
return hashlib.md5(json_data.encode("utf-8")).hexdigest()
def json_dumps(self, obj: Any, sort_keys: bool = False) -> str:
return json.dumps(
obj, default=utils.json_int_dttm_ser, ignore_nan=True,
sort_keys=sort_keys
)
+
+ def exec_post_processing(self, df: DataFrame) -> DataFrame:
+ """
+ Perform post processing operations on DataFrame.
+
+ :param df: DataFrame returned from database model.
+ :return: new DataFrame to which all post processing operations have
been
+ applied
Review comment:
nit: Add `raises:` here and declare possible exceptions
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]