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 deep equality logic #4730

Merged
merged 2 commits into from
Apr 3, 2018
Merged

Conversation

mistercrunch
Copy link
Member

Zeroed-in on this while a Deck Scatter Plot chart was prompting for
refresh on-load.

I'm pretty sure using JSON.stringify as a proxy for deep equality is
wrong.

Not sure how to handle yarn.lock changes here. The changes on yarn.lock
are the result of "only" running yarn add deep-equal

Zeroed-in on this while a Deck Scatter Plot chart was prompting for
refresh on-load.

I'm pretty sure using JSON.stringify as a proxy for deep equality is
wrong.

Not sure how to handle yarn.lock changes here. The changes on yarn.lock
are the result of "only" running `yarn add deep-equal`
@codecov-io
Copy link

codecov-io commented Apr 1, 2018

Codecov Report

Merging #4730 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4730      +/-   ##
==========================================
- Coverage   72.22%   72.22%   -0.01%     
==========================================
  Files         204      204              
  Lines       15323    15325       +2     
  Branches     1180     1181       +1     
==========================================
+ Hits        11067    11068       +1     
- Misses       4253     4254       +1     
  Partials        3        3
Impacted Files Coverage Δ
superset/assets/javascripts/reduxUtils.js 74.57% <100%> (+0.43%) ⬆️
...cripts/explore/components/ExploreViewContainer.jsx 0% <0%> (ø) ⬆️
...set/assets/javascripts/explore/stores/controls.jsx 39.25% <0%> (ø) ⬆️

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 069d61c...d8da4e3. Read the comment docs.

@timifasubaa
Copy link
Contributor

Since the package.json was updated, can you also update the yarn.lock file?

@mistercrunch
Copy link
Member Author

@timifasubaa it's in there, it's just collapsed

Copy link
Member

@betodealmeida betodealmeida left a comment

Choose a reason for hiding this comment

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

Looks good to me, just a note about the equality comparison.

@@ -95,5 +96,5 @@ export function areArraysShallowEqual(arr1, arr2) {
}

export function areObjectsEqual(obj1, obj2) {
return JSON.stringify(obj1) === JSON.stringify(obj2);
return equals(obj1, obj2);
Copy link
Member

Choose a reason for hiding this comment

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

This will compare leaves using == instead of ===, is that the intended behavior? If not, you can pass opts.strict as true.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch. == would have been ok in most cases but === is preferable. We may not need this utility function anymore but I'm leaving it to minimize code changes.

@mistercrunch mistercrunch merged commit 969ff0c into apache:master Apr 3, 2018
michellethomas pushed a commit to michellethomas/panoramix that referenced this pull request May 24, 2018
* Fix deepequality logic

Zeroed-in on this while a Deck Scatter Plot chart was prompting for
refresh on-load.

I'm pretty sure using JSON.stringify as a proxy for deep equality is
wrong.

Not sure how to handle yarn.lock changes here. The changes on yarn.lock
are the result of "only" running `yarn add deep-equal`

* Adressing comments
timifasubaa pushed a commit to timifasubaa/incubator-superset that referenced this pull request May 31, 2018
* Fix deepequality logic

Zeroed-in on this while a Deck Scatter Plot chart was prompting for
refresh on-load.

I'm pretty sure using JSON.stringify as a proxy for deep equality is
wrong.

Not sure how to handle yarn.lock changes here. The changes on yarn.lock
are the result of "only" running `yarn add deep-equal`

* Adressing comments
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
* Fix deepequality logic

Zeroed-in on this while a Deck Scatter Plot chart was prompting for
refresh on-load.

I'm pretty sure using JSON.stringify as a proxy for deep equality is
wrong.

Not sure how to handle yarn.lock changes here. The changes on yarn.lock
are the result of "only" running `yarn add deep-equal`

* Adressing comments
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.25.0 labels Feb 27, 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 🚢 0.25.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants