ordering in mysql
This commit is contained in:
@@ -1911,12 +1911,12 @@ def read_cols_df_sql(ids, columns, convertnewtons=True):
|
||||
# columns=cls,
|
||||
# ))
|
||||
elif len(ids) == 1:
|
||||
query = sa.text('SELECT {columns} FROM strokedata WHERE workoutid={id}'.format(
|
||||
query = sa.text('SELECT {columns} FROM strokedata WHERE workoutid={id} ORDER BY time ASC'.format(
|
||||
id=ids[0],
|
||||
columns=cls,
|
||||
))
|
||||
else:
|
||||
query = sa.text('SELECT {columns} FROM strokedata WHERE workoutid IN {ids}'.format(
|
||||
query = sa.text('SELECT {columns} FROM strokedata WHERE workoutid IN {ids} ORDER BY time ASC'.format(
|
||||
columns=cls,
|
||||
ids=tuple(ids),
|
||||
))
|
||||
@@ -1953,7 +1953,7 @@ def read_cols_df_sql(ids, columns, convertnewtons=True):
|
||||
def read_df_sql(id):
|
||||
engine = create_engine(database_url, echo=False)
|
||||
|
||||
df = pd.read_sql_query(sa.text('SELECT * FROM strokedata WHERE workoutid={id}'.format(
|
||||
df = pd.read_sql_query(sa.text('SELECT * FROM strokedata WHERE workoutid={id} ORDER BY time ASC'.format(
|
||||
id=id)), engine)
|
||||
|
||||
engine.dispose()
|
||||
|
||||
Reference in New Issue
Block a user