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(explore): Value undefined and Unhashable type errors #22207

Merged
merged 2 commits into from
Nov 23, 2022

Conversation

kgabryje
Copy link
Member

SUMMARY

This PR fixes 2 issues:

  1. Due to some faulty logic on the frontend, sometimes we converted metric control value from a string to an array. That resulted in Unhashable type: 'list' error.
  2. When user opened a chart, changed dataset, then changed viz type, and then clicked "Update chart", Explore would crash with undefined error. That's because of the fact that we were expecting all the controls from the previous viz type to still be available and have values, which might not be the case after changing viz type.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:

Screen.Recording.2022-11-23.at.17.28.30.mov
Screen.Recording.2022-11-23.at.17.29.10.mov

After:

Screen.Recording.2022-11-23.at.17.35.58.mov

TESTING INSTRUCTIONS

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

@kgabryje kgabryje requested review from villebro and geido November 23, 2022 16:36
@kgabryje kgabryje changed the title Fix/explore value undefined fix(explore): Value undefined and Unhashable type errors Nov 23, 2022
Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

One minor first pass comment, will test in an hour or so

@@ -276,21 +277,36 @@ export const ControlPanelsContainer = (props: ControlPanelsContainerProps) => {
>(state => state.explore.controlsTransferred);

useEffect(() => {
const removeDatasourceWarningFromControl = (
Copy link
Member

Choose a reason for hiding this comment

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

nit: Could we define this outside in a useCallback?

Copy link
Member Author

Choose a reason for hiding this comment

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

We could, but that wouldn't bring much value I think since we won't use it in any other place. I guess it's a style preference

Copy link
Member

Choose a reason for hiding this comment

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

You're right, I've tended to err on the side of just spraying useCallback everywhere, but I agree it's not really needed in trivial cases like this where 1) creating it is dirt cheap 2) it's not being used in a prop.

@kgabryje
Copy link
Member Author

/testenv up

@github-actions
Copy link
Contributor

@kgabryje Ephemeral environment spinning up at http://35.86.252.223:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@codecov
Copy link

codecov bot commented Nov 23, 2022

Codecov Report

Merging #22207 (97a373f) into master (d1567ba) will decrease coverage by 0.00%.
The diff coverage is 9.09%.

@@            Coverage Diff             @@
##           master   #22207      +/-   ##
==========================================
- Coverage   67.00%   66.99%   -0.01%     
==========================================
  Files        1835     1835              
  Lines       69971    69976       +5     
  Branches     7590     7592       +2     
==========================================
+ Hits        46881    46882       +1     
- Misses      21124    21128       +4     
  Partials     1966     1966              
Flag Coverage Δ
javascript 53.80% <9.09%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
.../src/explore/components/ControlPanelsContainer.tsx 75.35% <9.09%> (-2.03%) ⬇️
...ews/CRUD/annotationlayers/AnnotationLayersList.tsx 68.05% <0.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

LGTM

@kgabryje kgabryje merged commit 1809d2b into apache:master Nov 23, 2022
@github-actions
Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

justinpark pushed a commit to airbnb/superset-fork that referenced this pull request Nov 23, 2022
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Nov 28, 2022
@sadpandajoe
Copy link
Member

🏷️ preset:2022.47

@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 and removed 🚢 2.1.3 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/M 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants