Spec check misses NewType arguments of a generic group
Los mantenedores suelen responder en 1 día
@SimonHeybrock ya está trabajando en esto.
Desde el 28/10/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Summary
A spec may use a generic group parametrized with a NewType, such as essreduce's polarization markers. WorkflowSpec accepts it, but two such parameters serialize as one type, so a consumer of the serialized spec cannot tell them apart. It has the same root cause as scipp/sciline#250: pydantic names a generic model after its arguments, and gives every NewType the name NewType.
Reproducer
Polarizer = NewType('Polarizer', str) # as in ess.reduce.polarization.types
Analyzer = NewType('Analyzer', str)
E = TypeVar('E')
class He3Cell(BaseModel, Generic[E]):
pressure: float = Field(1.0, gt=0)
class Params(BaseModel):
polarizer: He3Cell[Polarizer]
analyzer: He3Cell[Analyzer]
spec = WorkflowSpec(..., params=Params, ...) # accepted
schema = spec.serialize().params_schema
list(schema['$defs']) # [..., 'He3Cell_NewType_', ...]: one entry for both
schema['properties']['polarizer'] # ... 'dataType': 'He3Cell[NewType]'
schema['properties']['analyzer'] # ... 'dataType': 'He3Cell[NewType]'
Impact
Inside one process nothing goes wrong. The backend fits a reference by class identity (field_types.fits), and a PipelineBinding uses the class objects as sciline keys. A consumer that only has the serialized spec, such as a remote UI, matches an output to a parameter by dataType. It would offer a polarizer cell's output for the analyzer, and the other way round. No such consumer exists yet.
Proposal
Refuse it when the spec is made, as the rule "no NewType or type alias, at any depth" already intends (essspec ADR 0001). The check misses this case because field_types.arguments uses typing.get_args, which does not see the arguments of a parametrized pydantic model. Those are in __pydantic_generic_metadata__['args']. With them included, the existing message applies: a spec names a role by a class.
The fix at the source is in essreduce: define the markers as classes (class Polarizer: ...). That also fixes scipp/sciline#250 for these keys. Until then, a spec over essreduce's He3 workflow defines its own marker classes, and its binding maps them to essreduce's keys.
- Lenguaje dominante
- Python
- Estrellas
- 0
- Forks
- 1
- Merge medio
- 9 h 40 min
- PR fusionados (30 d)
- 60
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de scipp/essapps
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
A number that is not finite is stored as None at a field that accepts NonePosiblemente ocupada @jeevanabhi-r la tomó hace 3 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
scipp/essapps#140 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
scipp/essapps#152 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
Todos los issues de scipp/essapps
Issues similares
-
[yugabyted] xcluster set_up and add_to_replication fail for database names containing - . or (Abiertokind/bug priority/medium qa_automation
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
yugabyte/yugabyte-db#37324 ·
Los mantenedores suelen responder en 1 día
-
good first issue
Dificultad 1/5 Menos de una hora Aptitud para principiantes 87/100
btclib-org/btclib-node#2260 ·
Los mantenedores suelen responder en 1 día
-
ChatBedrockConverse changes the keys of JSON tool results to camelCase (`order_id` becomes `orderId`)Posiblemente ocupada @geyazheng la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
langchain-ai/langchain-aws#1469 ·
Los mantenedores suelen responder en 1 día
-
GCToggler leaves collection enabled if the body re-enables itPosiblemente ocupada @Gambit-Checkmate la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 7 días
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
EESSI/docs#949 · 1 comentario ·
Los mantenedores suelen responder en 1 día