Skip to content

feat : Improve Batch Analytics with CSV Upload

What does this MR do and why?

This MR resolves the issue of the Batch Analytics page previously only supporting .txt file uploads, which created unnecessary friction for users managing team data in spreadsheets. It introduces full support for .csv file imports while simultaneously fixing critical backend connection bugs.

Key Features & Fixes:

  1. Added CSV Import Support: The file uploader in batch.py has been updated to accept .csv files. It utilizes pandas to intelligently parse the file, automatically looking for headers like username/GitLab Username and college/institution column to map users. If no headers exist, it falls back to parsing the first columns automatically.
  2. Backward Compatibility: Manual text area entry continues to work perfectly. The logic deduplicates and merges users if they are entered in both the text area and the uploaded CSV.
  3. UI & Export Adjustments: Re-formatted the placeholder text in the manual entry box to clarify the user, college format, and removed the Excel export button per requirements.

References

Issue Number : #66 (closed)

Screenshots or screen recordings

(Please upload screenshots here showing the new CSV upload box, the updated placeholder text, and the final rendered Batch data table)

Before

Screenshot from 2026-04-21 16-06-51.png

After

image.png

image.png

How to set up and validate locally

  1. Pull the feature/csv-import-batch-analytics branch locally.

  2. Run the application:

    uv run streamlit run app.py
  3. Navigate to the Batch Analytics page from the sidebar.

  4. Test CSV Upload: Upload a .csv file containing a username and (optionally) a college column.

  5. Test Manual Entry: Type your_username, your_college in the text area.

  6. Click Run Unified Analysis.

  7. Verify that the application successfully fetches data, correctly attributes the "College" field in the table, and does not crash with a Timeout context manager error in your terminal.

  8. Verify that the Excel download option is no longer visible at the bottom of the page.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

  • Tested CSV imports with and without headers.
  • Verified backward compatibility with manual entry.
  • Verified Timeout context manager error is completely resolved for large batch sizes.
  • Token changes successfully invalidate the UI cache.
Edited by Pavani Pothuganti

Merge request reports

Loading