|
1 | 1 | from ..utils import DataikuException |
2 | 2 | from ..utils import DataikuUTF8CSVReader |
3 | 3 | from ..utils import DataikuStreamedHttpUTF8CSVReader |
| 4 | +import json |
4 | 5 |
|
5 | 6 | class DSSSQLQuery(object): |
6 | 7 | """ |
7 | 8 | A connection to a database or database-like on which queries can be run through DSS |
8 | 9 | """ |
9 | | - def __init__(self, client, query, connection, database, dataset_full_name, pre_queries, post_queries, type, extra_conf): |
| 10 | + def __init__(self, client, query, connection, database, dataset_full_name, pre_queries, post_queries, type, extra_conf, script_steps, script_input_schema, script_output_schema, script_report_location): |
10 | 11 | self.client = client |
11 | | - self.query = query |
12 | | - self.connection = connection |
13 | | - self.database = database |
14 | | - self.dataset_full_name = dataset_full_name |
15 | | - self.pre_queries = pre_queries |
16 | | - self.post_queries = post_queries |
17 | | - self.extra_conf = extra_conf |
18 | | - self.type = type |
19 | 12 |
|
20 | 13 | self.streaming_session = self.client._perform_json( |
21 | 14 | "POST", "/sql/queries/", |
22 | 15 | body = { |
23 | | - "query" : self.query, |
24 | | - "preQueries" : self.pre_queries, |
25 | | - "postQueries" : self.post_queries, |
26 | | - "connection" : self.connection, |
27 | | - "database" : self.database, |
28 | | - "datasetFullName" : self.dataset_full_name, |
29 | | - "type" : self.type, |
30 | | - "extraConf" : extra_conf |
| 16 | + "query" : query, |
| 17 | + "preQueries" : pre_queries, |
| 18 | + "postQueries" : post_queries, |
| 19 | + "connection" : connection, |
| 20 | + "database" : database, |
| 21 | + "datasetFullName" : dataset_full_name, |
| 22 | + "type" : type, |
| 23 | + "extraConf" : extra_conf, |
| 24 | + "scriptSteps" : script_steps, |
| 25 | + "scriptInputSchema" : script_input_schema, |
| 26 | + "scriptOutputSchema" : script_output_schema, |
| 27 | + "scriptReportLocation" : script_report_location |
31 | 28 | }) |
32 | 29 | self.queryId = self.streaming_session['queryId'] |
33 | 30 |
|
|
0 commit comments