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

refactor: Unify shared datasources reducers and actions #20645

Conversation

michael-s-molina
Copy link
Member

SUMMARY

Dashboards and Explore contain Redux state about datasources. This PR refactors the code to extract this functionality into shared files under the datasource folder.

The names datasource and dataset are being used interchangeably. It would be a good idea to rename all to dataset in the future but this involves changing the Redux state, so it requires its own PR.

This is a follow-up of #20572

TESTING INSTRUCTIONS

We shouldn’t have any differences in terms of functionality.

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

@codecov
Copy link

codecov bot commented Jul 7, 2022

Codecov Report

Merging #20645 (e1dafe7) into master (ae8c931) will decrease coverage by 0.02%.
The diff coverage is 21.05%.

@@            Coverage Diff             @@
##           master   #20645      +/-   ##
==========================================
- Coverage   66.79%   66.77%   -0.03%     
==========================================
  Files        1753     1753              
  Lines       65618    65850     +232     
  Branches     6952     7027      +75     
==========================================
+ Hits        43831    43971     +140     
- Misses      20023    20091      +68     
- Partials     1764     1788      +24     
Flag Coverage Δ
javascript 51.91% <21.05%> (+0.05%) ⬆️

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

Impacted Files Coverage Δ
...d/packages/superset-ui-chart-controls/src/types.ts 100.00% <ø> (ø)
...rset-frontend/src/components/Chart/chartReducer.ts 25.00% <0.00%> (ø)
...t-frontend/src/dashboard/actions/dashboardState.js 36.54% <ø> (ø)
...set-frontend/src/dashboard/containers/Dashboard.ts 0.00% <ø> (ø)
...rontend/src/dashboard/containers/DashboardPage.tsx 5.26% <ø> (ø)
...tend/src/dashboard/util/fetchDatasourceMetadata.ts 0.00% <0.00%> (ø)
superset-frontend/src/datasource/reducer.ts 14.28% <0.00%> (ø)
...set-frontend/src/explore/actions/exploreActions.ts 50.00% <0.00%> (-8.34%) ⬇️
.../explore/components/ExploreViewContainer/index.jsx 52.84% <ø> (ø)
...rset-frontend/src/hooks/apiResources/dashboards.ts 36.36% <0.00%> (ø)
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ae8c931...e1dafe7. Read the comment docs.

@kgabryje
Copy link
Member

kgabryje commented Jul 8, 2022

/testenv up

@github-actions
Copy link
Contributor

github-actions bot commented Jul 8, 2022

@kgabryje Container image not yet published for this PR. Please try again when build is complete.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 8, 2022

@kgabryje Ephemeral environment creation failed. Please check the Actions logs for details.

@kgabryje
Copy link
Member

kgabryje commented Jul 8, 2022

/testenv up

@github-actions
Copy link
Contributor

github-actions bot commented Jul 8, 2022

@kgabryje Container image not yet published for this PR. Please try again when build is complete.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 8, 2022

@kgabryje Ephemeral environment creation failed. Please check the Actions logs for details.

Copy link
Member

@zhaoyongjie zhaoyongjie left a comment

Choose a reason for hiding this comment

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

codes LGTM. Thanks for the clean up.

@michael-s-molina
Copy link
Member Author

/testenv up

@github-actions
Copy link
Contributor

github-actions bot commented Jul 8, 2022

@michael-s-molina Container image not yet published for this PR. Please try again when build is complete.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 8, 2022

@michael-s-molina Ephemeral environment creation failed. Please check the Actions logs for details.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 8, 2022

@michael-s-molina Container image not yet published for this PR. Please try again when build is complete.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 8, 2022

@michael-s-molina Ephemeral environment creation failed. Please check the Actions logs for details.

@andrey-zayats
Copy link

hi @michael-s-molina. I found 2 issues while testing your pr. ch-52581, ch-52589. Can you take a look?

@michael-s-molina
Copy link
Member Author

hi @michael-s-molina. I found 2 issues while testing your pr. ch-52581, ch-52589. Can you take a look?

Hi @andrey-zayats. Thank you for testing. I was able to reproduce both issues on master so it seems they're not related to this PR. I'll forward them to the patch team.

@andrey-zayats
Copy link

hi @michael-s-molina. I found 2 issues while testing your pr. ch-52581, ch-52589. Can you take a look?

Hi @andrey-zayats. Thank you for testing. I was able to reproduce both issues on master so it seems they're not related to this PR. I'll forward them to the patch team.

No other blockers. PR LGTM!

Copy link
Member

@jinghua-qa jinghua-qa left a comment

Choose a reason for hiding this comment

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

LGTM

@michael-s-molina michael-s-molina merged commit 2a70540 into apache:master Jul 13, 2022
michael-s-molina added a commit to michael-s-molina/superset that referenced this pull request Jul 20, 2022
michael-s-molina added a commit that referenced this pull request Jul 20, 2022
* Revert "fix: Error when saving datasource from Explore (#20749)"

This reverts commit 92f3621.

* Revert "refactor: Unify shared datasources reducers and actions (#20645)"

This reverts commit 2a70540.
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Jul 21, 2022
* Revert "fix: Error when saving datasource from Explore (apache#20749)"

This reverts commit 92f3621.

* Revert "refactor: Unify shared datasources reducers and actions (apache#20645)"

This reverts commit 2a70540.

(cherry picked from commit 3311128)
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 labels Mar 13, 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/L 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants