Commit 2dcfaf59 authored by 高雅喆's avatar 高雅喆

fix bug in eda/test/getTopFeatures.py with a redundant }

parent aa7d043a
...@@ -28,7 +28,7 @@ class TopFeatures(object): ...@@ -28,7 +28,7 @@ class TopFeatures(object):
self.cid_type = self.cid_type.replace(' ','') self.cid_type = self.cid_type.replace(' ','')
sql = "select cid,count(cid) from data_feed_click \ sql = "select cid,count(cid) from data_feed_click \
where from_unixtime(time,'%Y-%m-%d')=date_add(curdate(), interval -{0} day) \ where from_unixtime(time,'%Y-%m-%d')=date_add(curdate(), interval -{0} day) \
and device_type{1}} and cid_type='{2}' \ and device_type{1} and cid_type='{2}' \
group by cid order by count(cid) desc".format(self.ndays, self.platform, self.cid_type) group by cid order by count(cid) desc".format(self.ndays, self.platform, self.cid_type)
clk_times = tuple2dict(con_sql(sql)) clk_times = tuple2dict(con_sql(sql))
return clk_times return clk_times
...@@ -40,7 +40,7 @@ class TopFeatures(object): ...@@ -40,7 +40,7 @@ class TopFeatures(object):
self.cid_type = self.cid_type[:-6] + ' ' + self.cid_type[:-6:] self.cid_type = self.cid_type[:-6] + ' ' + self.cid_type[:-6:]
sql = "select cid,count(cid) from data_feed_exposure \ sql = "select cid,count(cid) from data_feed_exposure \
where from_unixtime(time,'%Y-%m-%d')=date_add(curdate(), interval -{0} day) \ where from_unixtime(time,'%Y-%m-%d')=date_add(curdate(), interval -{0} day) \
and device_type{1}} and cid_type='{2}' \ and device_type{1} and cid_type='{2}' \
group by cid order by count(cid) desc".format(self.ndays, self.platform, self.cid_type) group by cid order by count(cid) desc".format(self.ndays, self.platform, self.cid_type)
imp_times = tuple2dict(con_sql(sql)) imp_times = tuple2dict(con_sql(sql))
return imp_times return imp_times
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment