Skip to content

Commit 2b74dab

Browse files
committed
Show ungrouped repos better
1 parent 48ded3b commit 2b74dab

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

fetch_known_repos.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@
1010
def fetch_known_repos():
1111
load_dotenv(override=False)
1212

13-
conn = duckdb.connect("git.duckdb")
13+
conn = duckdb.connect(":memory:")
1414
with open('schema.sql') as f:
1515
conn.sql(f.read())
1616

17+
conn.sql("COPY providers FROM 'data/providers.csv' WITH (HEADER 1, DELIMITER E'\\t')")
18+
conn.sql("COPY repos FROM 'data/repos*.csv' WITH (HEADER 1, DELIMITER E'\\t')")
1719
repos = conn.sql("SELECT repos.repo, root || repo as root, origin || repo as origin FROM repos JOIN providers ON provider=providers.name").df()
1820

1921
for _, repo in track(list(repos.iterrows())):

pages/05_Projects-Groups.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ def main():
5252
with colored as (
5353
select repos.*, unnest(list_distinct({colors})) as color from repos where {filters.repo_filter}
5454
)
55-
SELECT repo FROM repos
56-
WHERE {filters.repo_filter} AND id not in (SELECT id FROM colored)
57-
group by repo ORDER BY repo DESC LIMIT 500
58-
""", params=filters.repo_params).df()
55+
SELECT repo, count(*) as count FROM repos join git_commits on repo_id=repos.id
56+
WHERE {filters.commit_filter} AND id not in (SELECT id FROM colored)
57+
group by repo ORDER BY count(*) DESC LIMIT 500
58+
""", params=filters.commit_params).df()
5959
st.markdown(f"### Uncategorized")
6060
st.dataframe(last_commits, hide_index=True, use_container_width=True)
6161

0 commit comments

Comments
 (0)