fix
This commit is contained in:
@@ -100,8 +100,22 @@ def alert_get_stats(alert, nperiod=0): # pragma: no cover
|
|||||||
boattype=alert.boattype)
|
boattype=alert.boattype)
|
||||||
ids = [w.id for w in workouts]
|
ids = [w.id for w in workouts]
|
||||||
|
|
||||||
df = getsmallrowdata_db(columns, ids=ids, doclean=True,
|
try:
|
||||||
workstrokesonly=workstrokesonly)
|
df = getsmallrowdata_db(columns, ids=ids, doclean=True,
|
||||||
|
workstrokesonly=workstrokesonly)
|
||||||
|
except:
|
||||||
|
return {
|
||||||
|
'workouts': workouts.count(),
|
||||||
|
'startdate': startdate,
|
||||||
|
'enddate': enddate,
|
||||||
|
'nr_strokes': 0,
|
||||||
|
'nr_strokes_qualifying': 0,
|
||||||
|
'percentage': 0,
|
||||||
|
'nperiod': nperiod,
|
||||||
|
'median': 0,
|
||||||
|
'median_q': 0,
|
||||||
|
'standard_dev': 0,
|
||||||
|
}
|
||||||
|
|
||||||
if df.empty:
|
if df.empty:
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1246,8 +1246,11 @@ def getsmallrowdata_db(columns, ids=[], doclean=True, workstrokesonly=True, comp
|
|||||||
if rowdata and len(rowdata.df):
|
if rowdata and len(rowdata.df):
|
||||||
_ = dataprep(rowdata.df, id=id,
|
_ = dataprep(rowdata.df, id=id,
|
||||||
bands=True, otwpower=True, barchart=True)
|
bands=True, otwpower=True, barchart=True)
|
||||||
df = pd.read_parquet(f, columns=columns)
|
try:
|
||||||
data.append(df)
|
df = pd.read_parquet(f, columns=columns)
|
||||||
|
data.append(df)
|
||||||
|
except (OSError, ArrowInvalid, IndexError):
|
||||||
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
df = pd.concat(data, axis=0)
|
df = pd.concat(data, axis=0)
|
||||||
|
|||||||
Reference in New Issue
Block a user