You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/01/11 02:24:12 UTC

[GitHub] [incubator-superset] john-bodley opened a new pull request #8948: [fix] Enforce the QueryResult.df to be a pandas.DataFrame (Phase II)

john-bodley opened a new pull request #8948: [fix] Enforce the QueryResult.df to be a pandas.DataFrame (Phase II)
URL: https://github.com/apache/incubator-superset/pull/8948
 
 
   ### CATEGORY
   
   Choose one
   
   - [ ] Bug Fix
   - [ ] Enhancement (new features, refinement)
   - [x] Refactor
   - [ ] Add tests
   - [ ] Build / Development Environment
   - [ ] Documentation
   
   ### SUMMARY
   
   Related to https://github.com/apache/incubator-superset/pull/8935 this PR cleans up other places in the code where the `df` variable was either `None` or a `pandas.DataFrame` object. Given that now both `QueryResult` and `pydruid` guarantee exporting of a `pandas.DataFrame` (which could be empty) the downstream logic is now simplified. 
   
   ### TEST PLAN
   
   CI. 
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Changes UI
   - [ ] Requires DB Migration.
   - [ ] Confirm DB Migration upgrade and downgrade tested.
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   ### REVIEWERS
   
   to: @mistercrunch @michellethomas @villebro @willbarrett 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] john-bodley merged pull request #8948: [fix] Enforce the QueryResult.df to be a pandas.DataFrame (Phase II)

Posted by GitBox <gi...@apache.org>.
john-bodley merged pull request #8948: [fix] Enforce the QueryResult.df to be a pandas.DataFrame (Phase II)
URL: https://github.com/apache/incubator-superset/pull/8948
 
 
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [incubator-superset] john-bodley commented on a change in pull request #8948: [fix] Enforce the QueryResult.df to be a pandas.DataFrame (Phase II)

Posted by GitBox <gi...@apache.org>.
john-bodley commented on a change in pull request #8948: [fix] Enforce the QueryResult.df to be a pandas.DataFrame (Phase II)
URL: https://github.com/apache/incubator-superset/pull/8948#discussion_r365492028
 
 

 ##########
 File path: superset/common/query_context.py
 ##########
 @@ -129,15 +129,14 @@ def get_data(  # pylint: disable=invalid-name,no-self-use
     def get_single_payload(self, query_obj: QueryObject) -> Dict[str, Any]:
         """Returns a payload of metadata and data"""
         payload = self.get_df_payload(query_obj)
-        df = payload.get("df")
-        status = payload.get("status")
+        df = payload["df"]
 
 Review comment:
   Note the `get` is not required as `get_df_payload` is guaranteed to return a dictionary with the `df` and `status` keys per [here](https://github.com/apache/incubator-superset/blob/5b690f94116b5b77c0af566d24f298cc6db469b9/superset/common/query_context.py#L234).

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org