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

[bugfix] geohash lat/long is reversed #5695

Merged
merged 3 commits into from
Aug 22, 2018

Conversation

mistercrunch
Copy link
Member

This allows support for reversing geohashes. Note that the default option was the wrong way.
screen shot 2018-08-21 at 8 43 36 pm

This allows support for reversing geohashes. Note that the default option
was the wrong way.
@codecov-io
Copy link

codecov-io commented Aug 22, 2018

Codecov Report

Merging #5695 into master will decrease coverage by 0.01%.
The diff coverage is 20%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5695      +/-   ##
==========================================
- Coverage   63.49%   63.48%   -0.02%     
==========================================
  Files         360      360              
  Lines       22934    22941       +7     
  Branches     2555     2555              
==========================================
+ Hits        14562    14564       +2     
- Misses       8357     8362       +5     
  Partials       15       15
Impacted Files Coverage Δ
superset/viz.py 81.21% <16.66%> (-0.1%) ⬇️
...src/explore/components/controls/SpatialControl.jsx 33.72% <25%> (-0.43%) ⬇️

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 80e7778...26a528d. Read the comment docs.

superset/viz.py Outdated
if spatial.get('reverseCheckbox'):
df[key] = [
tuple(reversed(o)) if isinstance(o, (list, tuple)) else (0, 0)
Copy link
Member

Choose a reason for hiding this comment

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

I'm happy we're getting rid of the (0, 0) here.

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah that place on the west coast of africa that throws the autozoom off...

superset/viz.py Outdated
latlong.apply(lambda x: x[1])))
df[key] = df[spatial.get('geohashCol')].map(geohash.decode)
if not spatial.get('reverseCheckbox'):
reverse_latlong()
Copy link
Member

Choose a reason for hiding this comment

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

This if block is super confusing... can't we fix geohash.decode instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

I can wrap it in a lambda that reverses it

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.

Gogogo

@mistercrunch mistercrunch merged commit b42f8a2 into apache:master Aug 22, 2018
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
* [bugfix] geohash lat/long is reversed

This allows support for reversing geohashes. Note that the default option
was the wrong way.

* addressing comments

* make reverse_geohash_decode a staticmethod
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.28.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.28.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants