Skip to content

Commit

Permalink
Allow tags to be None in validation (#419)
Browse files Browse the repository at this point in the history
* Allow tags to be None in validation

* Remove literal
  • Loading branch information
munrojm authored May 20, 2022
1 parent 63d6954 commit 62eaa05
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions emmet-core/emmet/core/tasks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from datetime import datetime
from enum import Enum
from typing import List, Dict
from typing import List, Dict, Union

from emmet.core.vasp.task_valid import TaskState

Expand Down Expand Up @@ -144,7 +144,7 @@ class TaskDoc(BaseModel):
Calculation-level details about VASP calculations that power Materials Project.
"""

tags: List[str] = Field(
tags: Union[List[str], None] = Field(
[], title="tag", description="Metadata tagged to a given task."
)

Expand Down
4 changes: 3 additions & 1 deletion emmet-core/emmet/core/vasp/task_valid.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ class BaseTaskDocument(EmmetBaseModel):
description="Timestamp for this task document was last updateed",
)

tags: List[str] = Field([], description="Metadata tags for this task document")
tags: Union[List[str], None] = Field(
[], description="Metadata tags for this task document"
)

warnings: List[str] = Field(
None, description="Any warnings related to this property"
Expand Down

0 comments on commit 62eaa05

Please sign in to comment.