Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] Enforce the QueryResult.df to be a pandas.DataFrame (Phase II) #8948

Merged

Conversation

john-bodley
Copy link
Member

CATEGORY

Choose one

  • Bug Fix
  • Enhancement (new features, refinement)
  • Refactor
  • Add tests
  • Build / Development Environment
  • Documentation

SUMMARY

Related to #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

  • 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

@@ -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"]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note the get is not required as get_df_payload is guaranteed to return a dictionary with the df and status keys per here.

@john-bodley john-bodley merged commit 0fe0471 into apache:master Jan 13, 2020
@john-bodley john-bodley deleted the john-bodley--fix-empty-data-frame branch January 13, 2020 05:35
@john-bodley john-bodley mentioned this pull request Jan 23, 2020
12 tasks
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.36.0 labels Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/S 🚢 0.36.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants