Skip to content

Fix module segment headers in analytics export#9206

Open
miachillgood wants to merge 1 commit into
makeplane:previewfrom
miachillgood:fix/module-segment-export-headers
Open

Fix module segment headers in analytics export#9206
miachillgood wants to merge 1 commit into
makeplane:previewfrom
miachillgood:fix/module-segment-export-headers

Conversation

@miachillgood
Copy link
Copy Markdown

@miachillgood miachillgood commented Jun 4, 2026

Summary

  • Resolve module segment CSV headers from module details instead of label details
  • Add unit coverage for module segment header mapping

Fixes #9174

Tests

  • git diff --check origin/preview...fix/module-segment-export-headers
  • python -m compileall -q apps/api/plane/bgtasks/analytic_plot_export.py apps/api/plane/tests/unit/bg_tasks/test_analytic_plot_export.py

Not run:

  • python -m pytest plane/tests/unit/bg_tasks/test_analytic_plot_export.py (local environment is missing the project dependency celery)
  • python -m ruff check ... (local environment is missing ruff)

Summary by CodeRabbit

  • Bug Fixes

    • Corrected module name resolution in segmented analytics exports, ensuring accurate module names display in CSV exports when segmenting data by module dimension.
  • Tests

    • Added unit tests verifying that module segment headers correctly display the associated module names in exported analytics data.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jun 4, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 4, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 905e6243-d8c0-43df-9b19-4fd2376455c8

📥 Commits

Reviewing files that changed from the base of the PR and between b6e47cc and 2f44d48.

📒 Files selected for processing (2)
  • apps/api/plane/bgtasks/analytic_plot_export.py
  • apps/api/plane/tests/unit/bg_tasks/test_analytic_plot_export.py

📝 Walkthrough

Walkthrough

This PR fixes a bug in analytics CSV export where module segment column headers displayed raw UUIDs instead of module names. The generate_segmented_rows function incorrectly looked up module names from label_details instead of module_details. The fix updates the lookup source, and a new unit test validates that module names now appear correctly in exported headers.

Changes

Module Segment Header Lookup Fix

Layer / File(s) Summary
Module segment header lookup and verification
apps/api/plane/bgtasks/analytic_plot_export.py, apps/api/plane/tests/unit/bg_tasks/test_analytic_plot_export.py
The generate_segmented_rows function now retrieves module entries from module_details instead of label_details when segmenting by module. A unit test class validates that header labels correctly resolve module names from the provided module_details mapping.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A UUID was hiding where names should gleam,
In module headers—a reviewer's bad dream!
But now module_details reveals the true name,
Headers shine bright, analytics aflame! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main fix: changing module segment header resolution from label_details to module_details in the analytics export functionality.
Description check ✅ Passed The description covers the key changes and references the linked issue, though it omits some template sections like Type of Change and Screenshots.
Linked Issues check ✅ Passed The code changes directly address issue #9174 by fixing the module segment header lookup to use module_details instead of label_details, and adding unit test coverage for this behavior.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing module segment headers in analytics export and adding appropriate test coverage, with no extraneous modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Module Segment Headers Show Raw UUIDs Instead of Names in Analytics Export

2 participants