From 798216bd008e3eb9b5a5519c5618d0bfc763d564 Mon Sep 17 00:00:00 2001 From: mechatroner Date: Wed, 12 Feb 2020 09:21:17 -0500 Subject: [PATCH] fix rbql integration --- sublime_rbql.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sublime_rbql.py b/sublime_rbql.py index 5bf39cc..56645b0 100644 --- a/sublime_rbql.py +++ b/sublime_rbql.py @@ -6,7 +6,7 @@ import tempfile import time -import rainbow_csv.rbql.rbql_csv as rbql_csv +import rainbow_csv.rbql as rbql def system_has_node_js(): @@ -25,11 +25,13 @@ def system_has_node_js(): def execute_python(src_table_path, encoding, query, input_delim, input_policy, out_delim, out_policy, dst_table_path): - error_info, warnings = rbql_csv.csv_run(query, src_table_path, input_delim, input_policy, dst_table_path, out_delim, out_policy, encoding) - if error_info is None: + try: + warnings = [] + rbql.query_csv(query, src_table_path, input_delim, input_policy, dst_table_path, out_delim, out_policy, encoding, warnings) return (None, None, warnings) - else: - return (error_info['type'], error_info['message'], warnings) + except Exception as e: + error_type, error_msg = rbql.exception_to_error_info(e) + return (error_type, error_msg, []) def execute_js(src_table_path, encoding, query, input_delim, input_policy, out_delim, out_policy, dst_table_path):