Skip to content

Commit 1845b45

Browse files
committed
pass 2 more parameters to public API for sql queries
1 parent effe779 commit 1845b45

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

dataikuapi/dss/sqlquery.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class DSSSQLQuery(object):
77
"""
88
A connection to a database or database-like on which queries can be run through DSS
99
"""
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+
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, read_timestamp_without_timezone_as_string, read_date_as_string):
1111
self.client = client
1212

1313
self.streaming_session = self.client._perform_json(
@@ -24,7 +24,9 @@ def __init__(self, client, query, connection, database, dataset_full_name, pre_q
2424
"scriptSteps" : script_steps,
2525
"scriptInputSchema" : script_input_schema,
2626
"scriptOutputSchema" : script_output_schema,
27-
"scriptReportLocation" : script_report_location
27+
"scriptReportLocation" : script_report_location,
28+
"readTimestampWithoutTimezoneAsString" : read_timestamp_without_timezone_as_string,
29+
"readDateAsString" : read_date_as_string
2830
})
2931
self.queryId = self.streaming_session['queryId']
3032

dataikuapi/dssclient.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def get_plugin(self, plugin_id):
182182
# SQL queries
183183
########################################################
184184

185-
def sql_query(self, query, connection=None, database=None, dataset_full_name=None, pre_queries=None, post_queries=None, type='sql', extra_conf={}, script_steps=None, script_input_schema=None, script_output_schema=None, script_report_location=None):
185+
def sql_query(self, query, connection=None, database=None, dataset_full_name=None, pre_queries=None, post_queries=None, type='sql', extra_conf={}, script_steps=None, script_input_schema=None, script_output_schema=None, script_report_location=None, read_timestamp_without_timezone_as_string=True, read_date_as_string=False):
186186
"""
187187
Initiate a SQL, Hive or Impala query and get a handle to retrieve the results of the query.
188188
Internally, the query is run by DSS. The database to run the query on is specified either by
@@ -199,7 +199,7 @@ def sql_query(self, query, connection=None, database=None, dataset_full_name=Non
199199
200200
:returns: A :class:`dataikuapi.dss.sqlquery.DSSSQLQuery` query handle
201201
"""
202-
return DSSSQLQuery(self, query, connection, database, dataset_full_name, pre_queries, post_queries, type, extra_conf, script_steps, script_input_schema, script_output_schema, script_report_location)
202+
return DSSSQLQuery(self, query, connection, database, dataset_full_name, pre_queries, post_queries, type, extra_conf, script_steps, script_input_schema, script_output_schema, script_report_location, read_timestamp_without_timezone_as_string, read_date_as_string)
203203

204204
########################################################
205205
# Users

0 commit comments

Comments
 (0)