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

Abierto
#1,105 2 comentarios 0 reacciones 0 asignados Ver en GitHub
enhancement
Lenguaje dominante
Python
Estrellas
26
Forks
53
Merge medio
2 d 6 h
PR fusionados (30 d)
10

Descripción

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)

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
build-system, ci-cd, tooling
Tipo de issue
Error
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Tranquilo
Claridad
Necesita aclaración
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.