Skip to content

Commit 005ae94

Browse files
committed
Minor error handling in _render_sources
1 parent cdfbac8 commit 005ae94

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

bigquery/query_builder.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,16 @@ def _render_sources(dataset, tables):
135135
"""
136136

137137
if isinstance(tables, dict):
138-
if tables['date_range']:
138+
if tables.get('date_range', False):
139139
try:
140140
dataset_table = '.'.join([dataset, tables['table']])
141141
return "FROM (TABLE_DATE_RANGE([{}], TIMESTAMP('{}'),"\
142142
" TIMESTAMP('{}'))) ".format(dataset_table,
143143
tables['from_date'],
144144
tables['to_date'])
145145
except KeyError as exp:
146-
raise Exception('Missing parameter %s' % (exp))
146+
logging.warn('Missing parameter %s in selecting sources' %
147+
(exp))
147148

148149
else:
149150
return "FROM " + ", ".join(

0 commit comments

Comments
 (0)