Skip to content

Commit 04a2b9f

Browse files
committed
Apply review suggesion for error logging from @mildbyte
1 parent 55c155f commit 04a2b9f

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

splitgraph/ingestion/sqlite/__init__.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import contextlib
22
import itertools
3+
import logging
34
import os
45
import re
56
import sqlite3
@@ -153,6 +154,9 @@ def sqlite_connection_to_introspection_result(con: sqlite3.Connection) -> Intros
153154
# remove tables with invalid untyped columns
154155
for t in tables_with_untyped_columns:
155156
if t in schema:
157+
logging.warning(
158+
"Ignoring table '%s' as it includes columns without a declared type." % t
159+
)
156160
del schema[t]
157161
return schema
158162

@@ -273,9 +277,11 @@ def _batched_copy(
273277
insert_table_contents,
274278
) # nosec
275279
except Exception as e:
276-
print(
277-
"Received exception %s running query '%s' with parameters %s"
278-
% (str(e), query, str(parameters))
280+
logging.error(
281+
"Error running query '%s' with parameters %s",
282+
query,
283+
str(parameters),
284+
exc_info=e,
279285
)
280286
raise e
281287
return total_row_count

0 commit comments

Comments
 (0)