AllenNeuralDynamics / AllenNeuralDynamics/dataverse-client

Autogen models: type hint Choice fields with Literal[...]

Abierto
#15 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
0
Forks
0
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

For the autogenerated dataverse table models (#14), "Choice" fields have a few different options their value can take, these are written into the table definition in powerplatform.

Image

It would be nice to automatically find these values somehow and construct a type hint like below for the formatted field (and maybe another with ints for the backend values):

```python
Literal[
"adlib: baseline weight establishment",
"active water restriction",
"adlib: paused water restriction",
"adlib: water restriction complete",
]
```

Maybe if it's not findable with the metadata endpoints, we could add something to the autogen process that allows overriding certain fields so we could just go write down the choices and have it end up in the models.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.