@@ -129,12 +129,16 @@ def dj_query_route(self):
129129 limit = int (request .args ["limit" ]) if "limit" in request .args else 1000 ,
130130 page = int (request .args ["page" ]) if "page" in request .args else 1 ,
131131 )
132- return NumpyEncoder .dumps (
133- dict (
134- recordHeader = record_header ,
135- records = table_records ,
136- totalCount = total_count ,
137- )
132+ return (
133+ NumpyEncoder .dumps (
134+ dict (
135+ recordHeader = record_header ,
136+ records = table_records ,
137+ totalCount = total_count ,
138+ )
139+ ),
140+ 200 ,
141+ {"Content-Type" : "application/json" },
138142 )
139143
140144
@@ -299,23 +303,31 @@ def dj_query_route(self):
299303 order = request .args ["order" ].split ("," ) if "order" in request .args else None ,
300304 )
301305
302- return NumpyEncoder .dumps (
303- dict (
304- recordHeader = record_header ,
305- records = table_records ,
306- totalCount = total_count ,
307- )
306+ return (
307+ NumpyEncoder .dumps (
308+ dict (
309+ recordHeader = record_header ,
310+ records = table_records ,
311+ totalCount = total_count ,
312+ )
313+ ),
314+ 200 ,
315+ {"Content-Type" : "application/json" },
308316 )
309317
310318 def attributes_route (self ):
311319 attributes_meta = _DJConnector ._get_attributes (
312320 self .fetch_metadata ["query" ] & self .restriction , include_unique_values = True
313321 )
314- return NumpyEncoder .dumps (
315- dict (
316- attributeHeaders = attributes_meta ["attribute_headers" ],
317- attributes = attributes_meta ["attributes" ],
318- )
322+ return (
323+ NumpyEncoder .dumps (
324+ dict (
325+ attributeHeaders = attributes_meta ["attribute_headers" ],
326+ attributes = attributes_meta ["attributes" ],
327+ )
328+ ),
329+ 200 ,
330+ {"Content-Type" : "application/json" },
319331 )
320332
321333
@@ -359,12 +371,16 @@ def dj_query_route(self):
359371 query = fetch_metadata ["query" ] & self .restriction ,
360372 fetch_args = fetch_metadata ["fetch_args" ],
361373 )
362- return NumpyEncoder .dumps (
363- dict (
364- recordHeader = record_header ,
365- records = table_records ,
366- totalCount = total_count ,
367- )
374+ return (
375+ NumpyEncoder .dumps (
376+ dict (
377+ recordHeader = record_header ,
378+ records = table_records ,
379+ totalCount = total_count ,
380+ )
381+ ),
382+ 200 ,
383+ {"Content-Type" : "application/json" },
368384 )
369385
370386
@@ -390,10 +406,14 @@ def __init__(self, *args, **kwargs):
390406
391407 def dj_query_route (self ):
392408 fetch_metadata = self .fetch_metadata
393- return NumpyEncoder .dumps (
394- (fetch_metadata ["query" ] & self .restriction ).fetch1 (
395- * fetch_metadata ["fetch_args" ]
396- )
409+ return (
410+ NumpyEncoder .dumps (
411+ (fetch_metadata ["query" ] & self .restriction ).fetch1 (
412+ * fetch_metadata ["fetch_args" ]
413+ )
414+ ),
415+ 200 ,
416+ {"Content-Type" : "application/json" },
397417 )
398418
399419
0 commit comments