I have the following query to retrieve a single column of data:
routes_query = select(
[schema.stop_times.c.route_number],
schema.stop_times.c.stop_id == stop_id
).distinct(schema.stop_times.c.route_number)
result = conn.execute(routes_query)
return [r['route_number'] for r in result]
I am wondering if there is a cleaner way to retrieve a native list of the data rows returned.
the most succinct way to pull out a list of 1-element tuples into a list is:
or: