fix: provide default 'None' on Optional fields (#358)

This commit is contained in:
Jonathon Belotti
2023-07-07 17:09:48 -04:00
committed by GitHub
parent bea007455d
commit 141662ab59
3 changed files with 6 additions and 6 deletions

View File

@@ -21,7 +21,7 @@ jobs:
python-version: "3.9"
- name: Install Modal client package and jupytext
run: pip install modal-client jupytext pydantic
run: pip install modal-client jupytext pydantic~=1.10
- name: Run deployment script
run: |

View File

@@ -97,7 +97,7 @@ jobs:
python-version: "3.9"
- name: Install dev dependencies
run: pip install pytest jupytext
run: pip install pytest jupytext pydantic~=1.10
- name: Install the Modal client
run: pip install modal-client

View File

@@ -26,12 +26,12 @@ class Example(BaseModel):
filename: str # absolute filepath to example file
module: Optional[
str
] # python import path, or none if file is not a py module.
] = None # python import path, or none if file is not a py module.
# TODO(erikbern): don't think the module is used (by docs or monitors)?
metadata: Optional[dict]
metadata: Optional[dict] = None
repo_filename: str # git repo relative filepath
cli_args: Optional[list] # Full command line args to run it
stem: Optional[str] # stem of path
cli_args: Optional[list] = None # Full command line args to run it
stem: Optional[str] = None # stem of path
_RE_NEWLINE = re.compile(r"\r?\n")