I have a SQL Operator that creates a simple json. The end goal is that json being sent to a rest API. I'm finding the process of sending a HTTP POST in SQL code complicated, so if I can get the json kicked back to airflow I can handle it from there. Any help on either approach would be appreciated.
Asked
Active
Viewed 290 times
1 Answers
0
So thanks to a coworker I was able to figure this out. The built in MsSqlHook has a get_first method that receives the first row from the results of the SQL code you give it. So in my case my SQL code returns a JSON in a single row with a single field, so using get_first I can retrieve that JSON and use a HTTPHook to send it to the rest API

Tevett Goad
- 138
- 1
- 7