Commit 9cfc81ea authored by mancini's avatar mancini

Fix missing where in default statement

parent ab0251f1
......@@ -74,6 +74,8 @@ def print_table(service: TAPService, args):
where_statement = args.where
cone_search = args.cone_search
save = args.save
if where_statement:
where_statement = "where " + where_statement
if cone_search:
ra, dec, radius = _parse_cone_search_ra_dec_radius(cone_search)
where_statement = " and ".join(filter(lambda x: len(x), (where_statement,
......@@ -81,7 +83,7 @@ def print_table(service: TAPService, args):
"CIRCLE('ICRS', {}, {}, {}))".format(ra, dec,
radius))))
query = 'select top {} * from {} where {}'.format(limit, table_name, where_statement)
query = 'select top {} * from {} {}'.format(limit, table_name, where_statement)
logging.debug('executing query %s', query)
result_set = service.search(query)
......@@ -97,7 +99,7 @@ def parse_arguments():
parser.set_defaults(func=lambda x, y: parser.print_help())
subparser = parser.add_subparsers()
subparser = parser.add_subparsers(description='possible commands are')
list_table_parser = subparser.add_parser('list_tables')
list_table_parser.set_defaults(func=list_tables)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment