Skip to content

Commit

Permalink
fix(bug): fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
giangbui committed Mar 23, 2018
1 parent af6fd0a commit 380882c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions peregrine/resources/submission/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ def root_graphql_query():
# if peregrine.utils.contain_node_with_category(data.json,'data_file') == False:
# return flask.jsonify({ 'errors': 'No data_file node'}), 400
print("========dir(data)===========")
print(dir(data))
res = peregrine.utils.json2tbl(data.json,'', "_" )
print(data.data)
res = peregrine.utils.json2tbl(json.loads(data.data),'', "_" )
bag_info = {'organization': 'CDIS',
'data_type': 'TOPMed',
'date_created': datetime.date.today().isoformat()}
Expand Down
7 changes: 5 additions & 2 deletions peregrine/utils/pybdbag.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@ def create_bdbag(bag_path, bag_info, payload, max_row=10000):
header = copy.deepcopy(row)
writer.writerow(row)
nrow = 1
print('==============header==========')
print(header)
for row_dict in payload:
row=[]
print(row_dict)
for h in header:
if row_dict['_data_'+h]:
row.append(row_dict['_data_'+h])
if row_dict.get('_data_'+h):
row.append(row_dict.get('_data_'+h))
else:
row.append('None')
writer.writerow(row)
Expand Down

0 comments on commit 380882c

Please sign in to comment.