Skip to content

feat: support alternate xlsx header formats and auto-load .env#1

Merged
jeremyeder merged 1 commit intomainfrom
support-alternate-xlsx-headers
Mar 20, 2026
Merged

feat: support alternate xlsx header formats and auto-load .env#1
jeremyeder merged 1 commit intomainfrom
support-alternate-xlsx-headers

Conversation

@jeremyeder
Copy link
Copy Markdown
Contributor

Summary

  • Add HEADER_ALIASES so build_db.py accepts both original and alternate column names (e.g. "Scrum Team Name (miro)", "Jira Filter (Team reference)")
  • Auto-detect xlsx file whose sheets match the configured TAB_ORG_MAP
  • Load .env via python-dotenv so config is picked up without manual sourcing

Test plan

  • scripts/test.sh — 11/11 passing
  • Verified rebuild with both acme and real xlsx formats

🤖 Generated with Claude Code

Add HEADER_ALIASES so build_db.py accepts both original column names
(e.g. "Miro Team Name") and alternate formats (e.g. "Scrum Team Name
(miro)", "Jira Filter (Team reference)"). Auto-detect the xlsx file
whose sheets match the configured TAB_ORG_MAP. Load .env via
python-dotenv so GPS_TAB_ORG_MAP and other config is picked up
without manual sourcing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jeremyeder jeremyeder merged commit 15718d5 into main Mar 20, 2026
3 checks passed
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 20, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 431a962c-1be9-4ba8-af42-4f375bd8b88f

📥 Commits

Reviewing files that changed from the base of the PR and between 51185c9 and 548b45b.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • pyproject.toml
  • scripts/build_db.py

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting


Walkthrough

Added python-dotenv as a runtime dependency. Updated scripts/build_db.py to optionally load environment variables from .env, replaced static header list with aliases mapping, improved header matching logic, and refined XLSX discovery to prefer files with matching worksheet names.

Changes

Cohort / File(s) Summary
Dependency Update
pyproject.toml
Added python-dotenv>=1.0 as a required runtime dependency.
Script Logic Enhancements
scripts/build_db.py
Implemented optional .env file loading; replaced EXPECTED_HEADERS static list with HEADER_ALIASES mapping for flexible header matching; updated _match_header to resolve headers via canonical names and aliases; refined find_xlsx to prioritize .xlsx files with worksheet names matching TAB_ORG_MAP keys; removed unused sort parameter and added early return for no-candidates case.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch support-alternate-xlsx-headers

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

jeremyeder added a commit that referenced this pull request Mar 23, 2026
Add HEADER_ALIASES so build_db.py accepts both original column names
(e.g. "Miro Team Name") and alternate formats (e.g. "Scrum Team Name
(miro)", "Jira Filter (Team reference)"). Auto-detect the xlsx file
whose sheets match the configured TAB_ORG_MAP. Load .env via
python-dotenv so GPS_TAB_ORG_MAP and other config is picked up
without manual sourcing.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant