Last active
September 2, 2022 20:25
-
-
Save Zmey56/121d9b75bb444cd3322182193bc08151 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query_feed_q = """ | |
select | |
toDate(time) as date | |
,count(distinct user_id) as users_feed | |
,countIf(action='like') as likes | |
,countIf(action='view') as views | |
,countIf(action='like') / countIf(action='view') as CTR | |
,likes+views as events | |
from simulator_20220620.feed_actions | |
where toDate(time) between today() - 8 and today() - 1 | |
group by date | |
order by date | |
""" | |
data_feed = pd.DataFrame(ph.read_clickhouse(query=query_feed_q, connection=connection)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment