Survey banner
The Dataiku Community is moving to a new home! Some short term disruption starting next week: LEARN MORE

INSERT query from python function endpoint

Solved!
ssuhas76
Level 3
INSERT query from python function endpoint

Hi I am trying to execute a insert query from the dataikuapi client object. How do I get to know if the query is excecuted successfully or not?

 

import dataiku

client = dataiku.api_client()

query = "insert into table1 values('sample_string4','sample_string','sample_string','sample_string','sample_string','sample_string','Jan 1 2020')"

 

streamed_query = client.sql_query(query,connection="XXX",post_queries=['COMMIT'])

 

 

0 Kudos
1 Solution
Turribeach
0 Kudos
1 Reply
Turribeach

You need to call the verify() method, see this example:

https://developer.dataiku.com/latest/api-reference/python/sqlquery.html#dataikuapi.dss.sqlquery.DSSS...

streamed_query.verify()
0 Kudos

Labels

?

Setup info

?
A banner prompting to get Dataiku