airbytehq / airbytehq/airbyte-python-cdk

Codegen drift: Poe the Poet (version 0.48.0) Error: No poe configuration found from location /home/ubuntu Usage: poe [global options] task [task arguments] Global options: -h [TASK], --help [TASK] Show this help page and exit, optionally supply a task. --version Print the version and exit -v, --verbose Increase output (repeatable) -q, --quiet Decrease output (repeatable) -d, --dry-run Print the task contents

Aperta
#1,105 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
Python
Stelle
26
Fork
53
Merge medio
2g 6h
PR unite (30g)
10

Descrizione

Running `poetry run poe assemble` on a clean checkout of `main` produces ~350 lines of style drift in `airbyte_cdk/sources/declarative/models/declarative_component_schema.py` (e.g. `conint`/`confloat` usage, class reordering) that does not match the committed file, so contributors hand-patch the generated model instead of regenerating it.

Consequences observed while adding `UnionPartitionRouter` (https://github.com/airbytehq/airbyte-python-cdk/pull/1071):
- The YAML schema declares `minItems: 2` on `UnionPartitionRouter.partition_routers`, but the generated model has no corresponding constraint. The current codegen does not emit `min_items`, and pydantic v1 rejects a hand-added `min_items=2` on this self-referential `List[Union[...]]` field at import time ("field constraints are set but not enforced").
- There is no CI check that the committed generated file matches `poe assemble` output, so hand-maintained divergence accumulates silently.

Suggested follow-ups:
- Pin/align the datamodel-code-generator version so `poe assemble` reproduces the committed file byte-for-byte.
- Add an assemble-check CI job.
- Decide whether array constraints like `minItems` should be reflected in the generated models (may require pydantic v2 or generator options).

Requested by tolik0 in review of PR https://github.com/airbytehq/airbyte-python-cdk/pull/1071 (comment https://github.com/airbytehq/airbyte-python-cdk/pull/1071#discussion_r3719735982).

---
[Devin session](https://app.devin.ai/sessions/38753ed2d1f346e6a370888444676f4f)

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start by running `poetry run poe assemble` from a clean checkout and compare the output with `airbyte_cdk/sources/declarative/models/declarative_component_schema.py`. Review the code-generation configuration and existing CI setup, then determine how generated-file parity and the `minItems` behavior should be validated. Done means the intended generation and CI behavior is documented and reproducible without hand-patching.

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

Valutazione

Stack tecnologico
python
Ambito
build-system, ci-cd, tooling
Tipo di issue
Bug
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Tranquilla
Chiarezza
Da chiarire
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.