-
Notifications
You must be signed in to change notification settings - Fork 39
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
Spatial plus sign fix #249
Conversation
How does removing the |
We found that our code wasn't handling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this @btylerburton , one small change I think!
ckanext/geodatagov/logic.py
Outdated
# replace all instances of '+' as this creates bad JSON https://github.com/GSA/data.gov/issues/3549 | ||
old_spatial = old_spatial.replace('+', '') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want to try to leave old_spatial
as is, as that is the value given to us by the provider. I would rather see this change down near line 480, as the start of the transformation we do in that specific use case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @jbrown-xentity (having more context on this now)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had chained the fix into line 481 old_spatial.strip().split(',')
but then I realized that old_spatial is getting loaded in at L467 too and that we need to transform it before that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is anyone clear where initial spatial
is getting saved into old_spatial
? If I can find that I can ensure the initial value gets saved unchanged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although I don't like what I'm about to suggest, but the replace
function in python is a pass-by-value function, so there's technically no issue saving the result to a new variable. It creates more mess in the code, but I think that's what you need for it to load into json and then do the real work...
That makes sense. You're saying that whatever library couldn't convert the string |
2a0b86d
to
4c2cb24
Compare
Some further edification from the spec: https://stackoverflow.com/questions/26667313/does-json-allow-positive-sign-for-numbers |
For clarity, the internal variable in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚃
Pull Request
Related to GSA/data.gov#3549
About
PR TASKS