Explorar el Código

fix price_check to handle extra column in historic price query

Daniel Sheffield hace 2 años
padre
commit
de6cdadfa0
Se han modificado 1 ficheros con 5 adiciones y 5 borrados
  1. 5 5
      app/activities/Rating.py

+ 5 - 5
app/activities/Rating.py

@@ -15,7 +15,7 @@ class Rating(object):
             return ''
 
         return df.drop(labels=[
-            'id', 'avg', 'min', 'max', 'price', 'quantity', 'ts_raw', 'product', 'category', 'group'
+            'id', 'last', 'avg', 'min', 'max', 'price', 'quantity', 'ts_raw', 'product', 'category', 'group'
         ], axis=1).to_string(header=[
             'Date', 'Store', '$/unit', 'Org',
         ], justify='justify-all', max_colwidth=16, index=False)
@@ -39,15 +39,15 @@ class Rating(object):
                 p = 'badge_bad'
         else:
             p = 'badge_neutral'
-        
+
         for idx, (e, a) in enumerate(zip(ls, ls[1:])):
             if e <= _avg <= a:
                 for c, (_idx,_) in zip(''.join(list(f'{_avg:>5.2f}')[:idx+2]), filter(lambda x: idx-2 < x[0] and x[0]>0, enumerate(chars))):
                     chars[_idx] = (p, c)
-            
+
             if current is not None and e <= current < a:
                 rating[idx] = '^'
-        
+
         chars[0] = '|'
         chars[-1] = '|'
 
@@ -66,4 +66,4 @@ class Rating(object):
         else:
             self.text_fields['spread'].set_text('')
             self.text_fields['marker'].set_text('')
-        
+