bug: CLI `--source` accepts only 4 of the 7 `read_gifts` presets

オープン
#338 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@ShahadatTest がすでに取り組んでいます。

2026年11月3日 から。

  • #354 @ShahadatTest による — オープン
  • #356 @Sudhakar7J による — マージされずにクローズ

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
30/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
cli

調査の方向性

The hardcoded four-source tuple is _FEATURE_SOURCES in philanthropy/cli.py near line 47, and the if/elif reader chain is in _cmd_features near line 358. Read read_gifts and GIFT_SOURCES in the ingest module first, then check tests/test_cli.py for the existing features tests. Done means features --source accepts every name in GIFT_SOURCES and dispatches through read_gifts. Pull request #354 is already open against this issue, so check with the maintainers before starting.

索引モデルが issue の本文から書いたものです。

説明

bug easy good first issue roadmap

What happens

read_gifts and GIFT_SOURCES know seven presets: civicrm, raisers_edge, npsp, nonprofit_cloud, bloomerang, donorperfect, blackbaud_crm. The CLI still hardcodes four:

# philanthropy/cli.py:47
_FEATURE_SOURCES = ("civicrm", "raisers_edge", "npsp", "nonprofit_cloud")

So philanthropy features --source bloomerang --data gifts.csv fails with an argparse "invalid choice" error even though read_gifts(path, source="bloomerang") works. The same tuple gates train --source and check --source.

_cmd_features (philanthropy/cli.py:358) also re-implements the registry with an if/elif chain over the same four sources instead of calling read_gifts, which is how it fell behind each time a new reader landed.

Suggested fix

For features, replace the if/elif chain with ingest.read_gifts(args.data, source=args.source) and use ingest.GIFT_SOURCES as the choices. Keep the existing FileNotFoundError and KeyError handling around the call. Add a test in tests/test_cli.py that features accepts every name in GIFT_SOURCES, so the next reader is picked up automatically.

train --task leadership and check go through _read_raw_gifts, which needs each source's header canonicaliser and has its own bug (#337). Leave their choices on the four supported sources until that is fixed, so this issue stays a one-file change to _cmd_features plus its test.

主要言語
Python
スター
11
フォーク
23
平均マージ
2日 19時間
マージ済み PR(30日)
31

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

PhilanthroPy-Project/PhilanthroPy のほかの issue

PhilanthroPy-Project/PhilanthroPy の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。