If you can get ob-sql to output data in tabular form (if it is not nested) you can do something like this:
#+name: tabular
#+BEGIN_SRC python :results value
d = [['type', 'test'], ['format', 'json']]
return d
#+END_SRC
#+RESULTS: tabular
| type | test |
| format | json |
#+BEGIN_SRC emacs-lisp :var data=tabular :wrap json
(json-encode data)
#+END_SRC
#+RESULTS:
#+BEGIN_json
{"type":["test"],"format":["json"]}
#+END_json
If the data is nested, then you can see if there is a way to output a lisp readable string:
#+name: my-data
#+BEGIN_SRC python :results output
print('((type . test) (format . json))')
#+END_SRC
#+RESULTS: my-data
: ((type . test) (format . json))
#+BEGIN_SRC emacs-lisp :var data=my-data :wrap json
(json-encode (read data))
#+END_SRC
#+RESULTS:
#+BEGIN_json
{"type":"test","format":"json"}
#+END_json