Last active
July 20, 2021 19:52
-
-
Save mneedham/67cbf9d3bda3fc618eacfffa8bcbcf24 to your computer and use it in GitHub Desktop.
Basic Pinot query rendered in Streamlit
This file contains hidden or 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
| import streamlit as st | |
| from pinotdb import connect | |
| import pandas as pd | |
| st.title("GitHub Events") | |
| broker_port = 8000 | |
| conn = connect(host='localhost', port=broker_port, path='/query/sql', scheme='http') | |
| query = f""" | |
| select organization, count(*) AS count | |
| from pullRequestMergedEvents | |
| group by organization | |
| order by count DESC | |
| limit 10 | |
| """ | |
| curs = conn.cursor() | |
| curs.execute(query) | |
| st.header("Most active organisations") | |
| st.table(pd.DataFrame(curs, columns=[item[0] for item in curs.description])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment