chore(gate): review and reconcile new public API contract exemptions added since 0.7.0

Aperta
#357 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
Mezza giornata
Idoneità per principianti
35/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python, scikit-learn
Ambito
testing-qa

Direzione di ricerca

The exemptions live in tests/test_public_api_contract.py, where the API contract gate lists classes exempted since v0.7.0: GiftIntervalCalibrator, EncounterTransformer and MatchingGiftFeaturizer. Start by reading that file and comparing its exemption list against v0.7.0 to see what each class is and why it was exempted. Done means each exemption is either removed with the class brought into the contract, or explicitly ratified with the gate criteria in #351 updated to match. This needs maintainer judgement on the 1.0 API scope, so it is not a simple first edit.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

good first issue roadmap

Description

While auditing the 1.0 release gates in #351, Gate 2 failed the "no new exemptions since v0.7.0" check.

The following 3 exemptions were added to tests/test_public_api_contract.py since v0.7.0:

  • GiftIntervalCalibrator
  • EncounterTransformer
  • MatchingGiftFeaturizer

Goal

Review these exemptions to determine whether to remove them before 1.0 or explicitly ratify and update the gate criteria.

Linked from #351.

What the history shows (checked 2026-11-04 against e410de6)

None of the three loosens a check that a symbol already passed at 0.7.0 (tag af81521, 2026-08-21):

Exemption List Added in What it means
GiftIntervalCalibrator _EXEMPT 82ac4cc (2026-08-22) The class did not exist at 0.7.0. It was born exempt: it wraps an already-fitted regressor and returns a GiftInterval, so cls(**kwargs).fit(X, y) and one-value-per-row do not apply.
EncounterTransformer _EXEMPT_ARRAY_FIT 38548d1 (#198, 2026-09-08) _EXEMPT_ARRAY_FIT did not exist at 0.7.0. #198 added a new check (fit on an unnamed array) and, in the same commit, carved out the two transformers that look columns up by name.
MatchingGiftFeaturizer _EXEMPT_ARRAY_FIT 38548d1 (#198) Same as above.

All three are Tier 2 in docs/reference/index.md, and each entry already carries a written reason that test_every_exemption_carries_a_reason enforces.

So the contract got stricter, not looser. The gate's wording ("no exemption added since 0.7.0") is what fails, not its intent, and the [1.0.0] - TBD Notes in CHANGELOG.md currently state "The five 1.0 gates all hold at this commit", which is no longer true as written.

Acceptance criteria

  • Reword gate 2 in the ## [1.0.0] - TBD Notes of CHANGELOG.md to what it is meant to protect, e.g. "the public-API contract test is green, and no symbol that passed a contract check at 0.7.0 has since been exempted from it". Keep the rest of the Notes paragraph.
  • Record the three exemptions above as ratified, with their commits, in the PR body.
  • Optional, only if it stays small: a test that compares _EXEMPT and _EXEMPT_ARRAY_FIT against a frozen list, so any new exemption shows up as a test diff a reviewer has to approve. Skip it if it needs more than a few lines.
  • One CHANGELOG bullet under [Unreleased].

Scope

Gate wording and, optionally, the frozen-list test. No exemption is removed: removing either _EXEMPT_ARRAY_FIT entry would mean inventing positional semantics for transformers that join on a named column.

Where to start

  • tests/test_public_api_contract.py (_EXEMPT, _EXEMPT_ARRAY_FIT, around lines 40 to 95)
  • CHANGELOG.md, ## [1.0.0] - TBD, ### Notes
  • git log -S'"EncounterTransformer": (' -- tests/test_public_api_contract.py to see the history yourself

Dependencies

  • None. Unblocks the gate-2 line of #351.

Comment on this issue before you start so two people don't build the same thing.

Lingua principale
Python
Stelle
11
Fork
23
Merge medio
2g 19h
PR unite (30g)
31

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PhilanthroPy-Project/PhilanthroPy

Tutte le issue di PhilanthroPy-Project/PhilanthroPy

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.