Skip to content

Commit cf85569

Browse files
authored
Merge pull request #24 from vectordotdev/fix/contributor-monthly-current-month
Exclude current incomplete month from contributor_monthly
2 parents 3ddc319 + 5cbe39a commit cf85569

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/commands/generate_summaries.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,13 +327,15 @@ fn export_contributor_monthly(
327327
exclude_labels: Option<&[String]>,
328328
) -> Result<()> {
329329
let (wc, params) = build_where(table, exclude_labels, &["user_login IS NOT NULL"]);
330+
let current_month = Utc::now().format("%Y-%m").to_string();
330331
let query = format!(
331332
"SELECT substr({table}.created_at, 1, 7) AS month,
332333
{table}.user_login AS user_login,
333334
COUNT(*) AS count
334335
FROM {table}
335336
{wc}
336337
GROUP BY month, user_login
338+
HAVING month < '{current_month}'
337339
ORDER BY month, count DESC"
338340
);
339341
write_query_to_csv(

0 commit comments

Comments
 (0)