AllenNeuralDynamics / AllenNeuralDynamics/dataverse-client

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

未關閉
#15 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
0
分支
0
PR 合併指標
30 天內沒有已合併 PR

描述

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.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。