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: ODPS data source table preview failed #32301 #32310

Open
wants to merge 28 commits into
base: master
Choose a base branch
from

Conversation

zhutong6688
Copy link

@zhutong6688 zhutong6688 commented Feb 19, 2025

SUMMARY

I fixed an error when using sqllab to preview data after configuring the odps data source in superset, and added partition restrictions for previewing SQL

fixes: #32301

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

This is a preview of the odps table data before the repair:
image

This is a preview of the repaired ODPS table data:
5f49bcaba6d6cd31bdfdfae4ada6970
d2de24aca26b1c8560deaabbf3d1144
8aeca80279b56aaf4b3ee4ffeec96d5
In addition, when using other data sources, there is no problem with testing and it does not affect other data sources

TESTING INSTRUCTIONS

  1. First, configure the ODPS data source
  2. Create a new SQLlab page in the "SQL" column, select the database Schema
  3. Select partitioned tables, non partitioned tables, and multi partitioned tables in sequence to test the correctness of data preview
  4. Choose another data source, such as an example data source like SQLite, and follow the same steps as above to verify the validity of the data preview

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@github-actions github-actions bot added the api Related to the REST API label Feb 19, 2025
@dosubot dosubot bot added the sqllab Namespace | Anything related to the SQL Lab label Feb 19, 2025
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Congrats on making your first PR and thank you for contributing to Superset! 🎉 ❤️

We hope to see you in our Slack community too! Not signed up? Use our Slack App to self-register.

Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

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

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Fix Detected
Functionality Undefined partition variable in ODPS preview logic ▹ view
Files scanned
File Path Reviewed
superset/databases/utils.py
superset/daos/database.py
superset/sql/parse.py
superset/models/core.py
superset/databases/api.py
superset/db_engine_specs/base.py

Explore our documentation to understand the languages and file types we support and the files we ignore.

Need a new review? Comment /korbit-review on this PR and I'll review your latest changes.

Korbit Guide: Usage and Customization

Interacting with Korbit

  • You can manually ask Korbit to review your PR using the /korbit-review command in a comment at the root of your PR.
  • You can ask Korbit to generate a new PR description using the /korbit-generate-pr-description command in any comment on your PR.
  • Too many Korbit comments? I can resolve all my comment threads if you use the /korbit-resolve command in any comment on your PR.
  • Chat with Korbit on issues we post by tagging @korbit-ai in your reply.
  • Help train Korbit to improve your reviews by giving a 👍 or 👎 on the comments Korbit posts.

Customizing Korbit

  • Check out our docs on how you can make Korbit work best for you and your team.
  • Customize Korbit for your organization through the Korbit Console.

Feedback and Support

@hainenber
Copy link
Contributor

Thank you for the PR! I left a few comments and also you'll need to run added changes against established pre-commit hooks here.

access_id = match.group('username')
project = match.group('project')
endpoint = match.group('endpoint')
access_key = passwd
Copy link
Contributor

Choose a reason for hiding this comment

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

Re-assign DB's password to a 3rd variable seems odd here.

Copy link
Author

Choose a reason for hiding this comment

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

Access_key=passwd, I assigned passwd to Access_key, so that when using ODPS to build connections later, I have a visual experience of AK and Secret

Copy link
Contributor

Choose a reason for hiding this comment

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

Are there any benefits aside of readability? I'm not holding strong opinion on this but feels like this assignment is a bit excessive.

@sadpandajoe sadpandajoe added the review:checkpoint Last PR reviewed during the daily review standup label Feb 19, 2025
@sadpandajoe sadpandajoe removed the review:checkpoint Last PR reviewed during the daily review standup label Feb 20, 2025
@rusackas
Copy link
Member

approving a CI run, and adding a couple more reviewers for good measure :)

@zhutong6688 zhutong6688 changed the title Fix ODPS data source table preview failed #32301 fix ODPS data source table preview failed #32301 Feb 22, 2025
@zhutong6688 zhutong6688 changed the title fix ODPS data source table preview failed #32301 fix: ODPS data source table preview failed #32301 Feb 22, 2025
@zhutong6688
Copy link
Author

Please approve and agree a CI run,I have made the necessary corrections based on the error message

@zhutong6688
Copy link
Author

Some of the data source test classes did not pass. Let me take a look at the problem again and see if there are any issues with the test classes being written

@zhutong6688
Copy link
Author

Please approve and agree a CI run again, Thanks a lot

Copy link

codecov bot commented Feb 23, 2025

Codecov Report

Attention: Patch coverage is 41.66667% with 28 lines in your changes missing coverage. Please review.

Project coverage is 76.24%. Comparing base (76d897e) to head (ee17868).
Report is 1476 commits behind head on master.

Files with missing lines Patch % Lines
superset/daos/database.py 26.08% 17 Missing ⚠️
superset/databases/api.py 16.66% 5 Missing ⚠️
superset/db_engine_specs/base.py 33.33% 4 Missing ⚠️
superset/sql/parse.py 75.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #32310       +/-   ##
===========================================
+ Coverage   60.48%   76.24%   +15.75%     
===========================================
  Files        1931      546     -1385     
  Lines       76236    39138    -37098     
  Branches     8568        0     -8568     
===========================================
- Hits        46114    29840    -16274     
+ Misses      28017     9298    -18719     
+ Partials     2105        0     -2105     
Flag Coverage Δ
hive 48.45% <39.58%> (-0.71%) ⬇️
javascript ?
mysql 75.82% <41.66%> (?)
postgres 75.89% <41.66%> (?)
presto ?
python 76.24% <41.66%> (+12.75%) ⬆️
sqlite 75.40% <41.66%> (?)
unit ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pull-request-size pull-request-size bot added size/L and removed size/M labels Feb 23, 2025
@zhutong6688
Copy link
Author

Could you please help me run a CI again so that I can see if there are any other check errors,Thanks again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Related to the REST API size/L sqllab Namespace | Anything related to the SQL Lab
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ODPS data source table preview failed
4 participants