Spaces:
Sleeping
Sleeping
nataliaElv
commited on
Commit
Β·
ef22b70
1
Parent(s):
edc31f9
Latest updates column
Browse files- app.py +27 -6
- issues.json +0 -0
app.py
CHANGED
@@ -20,6 +20,7 @@ def fetch_data():
|
|
20 |
'State': issue.state,
|
21 |
'Created at': issue.created_at,
|
22 |
'Closed at': issue.closed_at,
|
|
|
23 |
'Labels': [label.name for label in issue.labels],
|
24 |
'Reactions': issue.reactions['total_count'],
|
25 |
'Comments': issue.comments,
|
@@ -44,22 +45,31 @@ except:
|
|
44 |
# Section 1: Issue activity metrics
|
45 |
st.header("Issue activity metrics")
|
46 |
|
47 |
-
col1, col2 = st.columns(
|
48 |
|
49 |
state_counts = df['State'].value_counts()
|
50 |
open_issues = df.loc[df['State'] == 'open']
|
|
|
|
|
|
|
|
|
|
|
51 |
|
52 |
with col1:
|
53 |
st.metric(label="Open Issues", value=state_counts['open'])
|
54 |
|
55 |
with col2:
|
56 |
st.metric(label="Closed Issues", value=state_counts['closed'])
|
57 |
-
|
58 |
|
59 |
-
#
|
|
|
|
|
|
|
|
|
|
|
60 |
|
61 |
-
#
|
62 |
-
|
63 |
|
64 |
st.subheader("Latest bugs π")
|
65 |
bug_issues = open_issues[open_issues["Labels"].apply(lambda labels: "type: bug" in labels)]
|
@@ -75,6 +85,17 @@ st.dataframe(
|
|
75 |
}
|
76 |
)
|
77 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
# Section 2: Issue classification
|
79 |
st.header("Issue classification")
|
80 |
col1, col2 = st.columns(2)
|
@@ -132,7 +153,7 @@ st.dataframe(
|
|
132 |
# st.header("Issue dependencies")
|
133 |
# ## Map: dependencies between issues. Network of issue mentions.x
|
134 |
|
135 |
-
status.update(label="Checking for updated data...", state="running")
|
136 |
updated_data = fetch_data()
|
137 |
if df.equals(updated_data):
|
138 |
status.update(label="Data is up to date!", state="complete")
|
|
|
20 |
'State': issue.state,
|
21 |
'Created at': issue.created_at,
|
22 |
'Closed at': issue.closed_at,
|
23 |
+
'Last update': issue.updated_at,
|
24 |
'Labels': [label.name for label in issue.labels],
|
25 |
'Reactions': issue.reactions['total_count'],
|
26 |
'Comments': issue.comments,
|
|
|
45 |
# Section 1: Issue activity metrics
|
46 |
st.header("Issue activity metrics")
|
47 |
|
48 |
+
col1, col2, col3 = st.columns(3)
|
49 |
|
50 |
state_counts = df['State'].value_counts()
|
51 |
open_issues = df.loc[df['State'] == 'open']
|
52 |
+
closed_issues = df.loc[df['State'] == 'closed']
|
53 |
+
# closed_issues['Created at'] = pd.to_datetime(df['Created at'])
|
54 |
+
# # closed_issues['Closed at'] = pd.to_datetime(df['Closed at'])
|
55 |
+
# closed_issues['Time to Close'] = closed_issues['Closed at'] - closed_issues['Created at']
|
56 |
+
# closed_issues['Time to Close'] = closed_issues['Time to Close'].apply(lambda x: x if pd.isnull(x) else x.days)
|
57 |
|
58 |
with col1:
|
59 |
st.metric(label="Open Issues", value=state_counts['open'])
|
60 |
|
61 |
with col2:
|
62 |
st.metric(label="Closed Issues", value=state_counts['closed'])
|
|
|
63 |
|
64 |
+
# with col3:
|
65 |
+
# average_time_to_close = closed_issues['Time to Close'].mean()
|
66 |
+
# st.metric(label="Avg. Days to Close", value=average_time_to_close)
|
67 |
+
|
68 |
+
|
69 |
+
# TODO Plot: number of open vs closed issues by date
|
70 |
|
71 |
+
# TODO Dataframe: Unresolved conversations
|
72 |
+
## Issues with new comments (or updates?). Sorted by number of new comments (based on timeframe above) and/or date of last comment.
|
73 |
|
74 |
st.subheader("Latest bugs π")
|
75 |
bug_issues = open_issues[open_issues["Labels"].apply(lambda labels: "type: bug" in labels)]
|
|
|
85 |
}
|
86 |
)
|
87 |
|
88 |
+
st.subheader("Latest updates π")
|
89 |
+
st.dataframe(
|
90 |
+
open_issues[["Issue","Last update","URL"]].sort_values(by="Last update", ascending=False).head(10),
|
91 |
+
hide_index=True,
|
92 |
+
column_config={
|
93 |
+
"Issue": st.column_config.TextColumn("Issue", width=400),
|
94 |
+
"Last update": st.column_config.DatetimeColumn("Last update"),
|
95 |
+
"URL": st.column_config.LinkColumn("π", display_text="π")
|
96 |
+
}
|
97 |
+
)
|
98 |
+
|
99 |
# Section 2: Issue classification
|
100 |
st.header("Issue classification")
|
101 |
col1, col2 = st.columns(2)
|
|
|
153 |
# st.header("Issue dependencies")
|
154 |
# ## Map: dependencies between issues. Network of issue mentions.x
|
155 |
|
156 |
+
# status.update(label="Checking for updated data...", state="running")
|
157 |
updated_data = fetch_data()
|
158 |
if df.equals(updated_data):
|
159 |
status.update(label="Data is up to date!", state="complete")
|
issues.json
CHANGED
The diff for this file is too large to render.
See raw diff
|
|