Skip to content

Instantly share code, notes, and snippets.

@mneedham
Last active July 20, 2021 19:52
Show Gist options
  • Select an option

  • Save mneedham/67cbf9d3bda3fc618eacfffa8bcbcf24 to your computer and use it in GitHub Desktop.

Select an option

Save mneedham/67cbf9d3bda3fc618eacfffa8bcbcf24 to your computer and use it in GitHub Desktop.
Basic Pinot query rendered in Streamlit
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