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

Flow data results in a merged dataset is blank #1643

Closed
ukanga opened this issue Jun 29, 2019 · 10 comments · Fixed by #1773
Closed

Flow data results in a merged dataset is blank #1643

ukanga opened this issue Jun 29, 2019 · 10 comments · Fixed by #1773

Comments

@ukanga
Copy link
Member

ukanga commented Jun 29, 2019

The flow data results endpoint returns blank for a merged dataset form- https://api.ona.io/api/v1/flow-results/packages/{UUID}/responses whereas the data endpoint - https://api.ona.io/api/v1/data/{pk}.json - would return data.

There should be data returned from the flow data results endpoint.

Aha! Link: https://ona.aha.io/features/PROD-233

@ivermac ivermac added this to the Week 5-6 (2020) milestone Jan 27, 2020
@DavisRayM DavisRayM self-assigned this Jan 28, 2020
@DavisRayM
Copy link
Contributor

DavisRayM commented Jan 28, 2020

Merged Datasets / MergedXForms currently do not have a UUID. We might need to add the field in order to not go against the FLOIP Spec.

I feel like the migration necessary for this may break backwards compatibility. Should I go forward with this approach ?

CC: @ivermac @pld

@pld
Copy link
Member

pld commented Jan 28, 2020

Why would it break backwards compatibility?

@DavisRayM
Copy link
Contributor

DavisRayM commented Jan 28, 2020

Why would it break backwards compatibility?

Pre-existing Merged Datasets won't have the field and I feel like the UUID field should not allow null values. I think that would cause a lot of issues.

@DavisRayM
Copy link
Contributor

DavisRayM commented Jan 28, 2020

The other approach would be to allow null values on the field. But I'm not so sure how to go about updating and adding uuid's for Merged Datasets created before this change is implemented.

@pld
Copy link
Member

pld commented Jan 28, 2020

Why would it break backwards compatibility?

Pre-existing Merged Datasets won't have the field and I feel like the UUID field should not allow null values. I think that would cause a lot of issues.

Can we use a data migration to fill this field? An require that it not be null

@DavisRayM
Copy link
Contributor

DavisRayM commented Jan 28, 2020

Why would it break backwards compatibility?

Pre-existing Merged Datasets won't have the field and I feel like the UUID field should not allow null values. I think that would cause a lot of issues.

Can we use a data migration to fill this field? An require that it not be null

Confirmed with @ivermac seems like setting a default would fill the field. And from this post here, seems like its possible to set a uuid as default.

I'll go ahead with this approach.

@DavisRayM
Copy link
Contributor

DavisRayM commented May 7, 2020

Researched a bit into the FLOIP spec as suggested here. Noted down the following:

Screenshot 2020-05-07 at 09 59 36

The FLOIP spec supports the following Question types: multiple_choice_one/select_one, multiple_choice_many/select_many, numeric, open, text, image, video, audio, geo_point, date, time, datetime

The multiple_choice_many and multiple_choice_one seem to have been replaced with select_one and select_many... The spec lists multiple_choice_* here, but here it's select_one and select_many

Screenshot 2020-05-07 at 09 53 48

The 'name' metadata should be on the same level as 'title' according to this and this

The other change already identified in the conversation on #1773 is that the 'id' returned should be UUID4 (hex+digits) this would possibly require us to change how we set uuid's on onadata.. Optionally we can use uuid.UUID function to convert the hex values back to the full uuid

I think this changes should be in a separate issue all together, if they're needed.... thoughts ?

CC: @ukanga @ivermac @WinnyTroy @pld

@ukanga
Copy link
Member Author

ukanga commented May 7, 2020

The other change already identified in the conversation on #1773 is that the 'id' returned should be UUID4 (hex+digits) this would possibly require us to change how we set uuid's on onadata..

I think we do not necessarily need to change that but we could. From how we store it you can get the dashed version:

>>> import uuid
>>> uuid.UUID('a94dc0c6f4bb4cea95af8df3969c67bc')
UUID('a94dc0c6-f4bb-4cea-95af-8df3969c67bc')
>>>

@ukanga
Copy link
Member Author

ukanga commented May 7, 2020

Please create issues for the others so that we can make the changes to conform to specification.

@DavisRayM
Copy link
Contributor

DavisRayM commented May 7, 2020

Please create issues for the others so that we can make the changes to conform to specification.

Created an issue for the other changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants