Skip to content

Commit

Permalink
Merge pull request #967 from onaio/change-id-type-to-int
Browse files Browse the repository at this point in the history
Change tableau id type to int
  • Loading branch information
ukanga authored Mar 24, 2017
2 parents 910e6c2 + 364efc7 commit daf3355
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions onadata/apps/api/tests/viewsets/test_open_data_viewset.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,12 @@ def test_column_headers_endpoint(self):
response.data.get('table_alias')
)

_id_datatype = [
a.get('dataType')
for a in response.data['column_headers']
if a.get('id') == '_id'][0]
self.assertEqual(_id_datatype, 'int')

def test_uuid_endpoint(self):
self.view = OpenDataViewSet.as_view({
'get': 'uuid'
Expand Down
5 changes: 4 additions & 1 deletion onadata/apps/api/viewsets/open_data_viewset.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ def append_to_tableau_colulmn_headers(header, question_type=None):
append_to_tableau_colulmn_headers(header, quest_type)
break
else:
append_to_tableau_colulmn_headers(header)
if header == '_id':
append_to_tableau_colulmn_headers(header, "int")
else:
append_to_tableau_colulmn_headers(header)

return tableau_colulmn_headers

Expand Down

0 comments on commit daf3355

Please sign in to comment.