Skip to content

Comments

fix: ODPS data source table preview failed #32301#32310

Closed
zhutong6688 wants to merge 39 commits intoapache:masterfrom
zhutong6688:fix-odps-partition-bug-32301
Closed

fix: ODPS data source table preview failed #32301#32310
zhutong6688 wants to merge 39 commits intoapache:masterfrom
zhutong6688:fix-odps-partition-bug-32301

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
@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

@zhutong6688
Copy link
Author

please help me run a CI again,thanks a lot

@zhutong6688
Copy link
Author

zhutong6688 commented Feb 24, 2025

@hainenber If you have time now,please help me run a CI again,thanks a lot

@zhutong6688
Copy link
Author

image
@hainenber May I ask if this error is caused by not installing and using pre commit?

@hainenber
Copy link
Contributor

I'd recommend to have precommit installed and used to catch early CI issues.

@zhutong6688
Copy link
Author

I'd recommend to have precommit installed and used to catch early CI issues.

Okay, got it

@zhutong6688 zhutong6688 requested a review from hainenber March 3, 2025 08:39
@zhutong6688
Copy link
Author

@hainenber please help me run a CI again,thanks a lot

@zhutong6688
Copy link
Author

Could you please help me agree and check the code online? Thank you

@hainenber
Copy link
Contributor

CI has already run. I’ll be reviewing your code.

@zhutong6688
Copy link
Author

I found that the code for table preview has been greatly adjusted, which is exactly where I fixed it. The interface calls are different from what I modified before, and the only thing fixed is the improvement. It is suggested to slow down the improvement of this section of code, as there are indeed many bugs and bug fixes cannot keep up with the speed of improving the code. This is not reasonable, and it is more appropriate to prioritize bug fixes in the code.

@zhutong6688
Copy link
Author

zhutong6688 commented Mar 4, 2025

@hainenber I have adjusted the code. Thank you for agreeing to run the constantly blocked reviews。
image

@zhutong6688
Copy link
Author

zhutong6688 commented Mar 10, 2025

@hainenber @rusackas @sadpandajoe @bgreenlee Let's take a look at this PR (#32556) later. The previous PR (#32310) modified a lot of underlying basic classes. Although other data sources were not affected according to my testing, the testing unit classes of superset need to be adjusted too much. Therefore, I submitted a new PR, which tries not to modify the underlying basic classes as much as possible, but modifies the logical collection to the odps.by file, without causing too much impact on a large number of unit testing classes.

@zhutong6688
Copy link
Author

Let's pay attention to this PR(https://github.com/apache/superset/pull/32556) in the future. This PR will be closed for now. It has modified many underlying classes, which requires too many modifications to the test classes of the superset project itself。

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