mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-27 00:07:16 +00:00
In sentiment analysis. if today top provider set is empty, try to take yesterday data and then takes from all_providers.
This commit is contained in:
parent
8359a6668f
commit
85ab0e36ff
1 changed files with 4 additions and 0 deletions
|
@ -463,6 +463,10 @@ def sentiment_analysis_getplotdata():
|
||||||
|
|
||||||
to_return = {}
|
to_return = {}
|
||||||
range_providers = r_serv_charts.zrevrangebyscore('providers_set_'+ get_date_range(0)[0], '+inf', '-inf', start=0, num=8)
|
range_providers = r_serv_charts.zrevrangebyscore('providers_set_'+ get_date_range(0)[0], '+inf', '-inf', start=0, num=8)
|
||||||
|
# if empty, get yesterday top providers
|
||||||
|
print 'providers_set_'+ get_date_range(1)[1]
|
||||||
|
range_providers = r_serv_charts.zrevrangebyscore('providers_set_'+ get_date_range(1)[1], '+inf', '-inf', start=0, num=8) if range_providers == [] else range_providers
|
||||||
|
# if still empty, takes from all providers
|
||||||
if range_providers == []:
|
if range_providers == []:
|
||||||
print 'today provider empty'
|
print 'today provider empty'
|
||||||
range_providers = r_serv_charts.smembers('all_provider_set')
|
range_providers = r_serv_charts.smembers('all_provider_set')
|
||||||
|
|
Loading…
Reference in a new issue