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

PXD-442 ⁃ auto-cast strings to proper type when appropriate #95

Open
frickjack opened this issue Mar 6, 2018 · 2 comments
Open

PXD-442 ⁃ auto-cast strings to proper type when appropriate #95

frickjack opened this issue Mar 6, 2018 · 2 comments
Assignees
Labels

Comments

@frickjack
Copy link
Contributor

frickjack commented Mar 6, 2018

sheepdog should be smart enough to auto-cast strings to the appropriate type (after validation) - so "11" gets cast to 11, or 11.0 gets cast to 11 for 'integer' type.

This kind of thing comes up a lot - ex: @cgmeyer reported

minor problem with using the form though:
when you enter an integer for, e.g., 4 for “number_of_melanomas_in_family”. when you click “upload submission json from form” it puts quotes around it (edited)
and then says it’s not an integer :
@frickjack frickjack added the bug label Mar 6, 2018
@philloooo philloooo changed the title auto-cast strings to proper type when appropriate PXD-442 ⁃ auto-cast strings to proper type when appropriate May 30, 2018
@philloooo philloooo added the bug label Aug 2, 2018
@trevars
Copy link

trevars commented Aug 2, 2018

➤ profoak commented:

Is this similar to what we do on xml submission?

https://github.com/uc-cdis/sheepdog/blob/master/sheepdog/utils/transforms/bcr_xml_to_json.py#L704-L718

@uc-cdis uc-cdis deleted a comment from philloooo Aug 2, 2018
@philloooo
Copy link
Contributor

yup, same concept, just do the auto-casting for json too

@philloooo philloooo added the bug label Aug 2, 2018
@uc-cdis uc-cdis deleted a comment from philloooo Aug 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants