Skip to content

Commit

Permalink
Mem (1/3): Fix schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
cjao committed Jul 11, 2023
1 parent 9f1c37c commit d094429
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions covalent/_shared_files/schemas/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@


class AssetSchema(BaseModel):
digest_alg: Optional[str]
digest: Optional[str]
uri: Optional[str]
remote_uri: Optional[str]
digest_alg: Optional[str] = None
digest: Optional[str] = None
uri: Optional[str] = None
remote_uri: Optional[str] = None

# Size of the asset in bytes
size: Optional[int] = 0
Expand Down
14 changes: 7 additions & 7 deletions covalent/_shared_files/schemas/electron.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ class ElectronAssets(BaseModel):
function_string: AssetSchema
value: AssetSchema
output: AssetSchema
error: Optional[AssetSchema]
stdout: Optional[AssetSchema]
stderr: Optional[AssetSchema]
error: Optional[AssetSchema] = None
stdout: Optional[AssetSchema] = None
stderr: Optional[AssetSchema] = None

# electron_metadata
deps: AssetSchema
Expand All @@ -100,10 +100,10 @@ class ElectronMetadata(BaseModel):
name: str
executor: str
executor_data: dict
sub_dispatch_id: Optional[str]
sub_dispatch_id: Optional[str] = None
status: StatusEnum
start_time: Optional[datetime]
end_time: Optional[datetime]
start_time: Optional[datetime] = None
end_time: Optional[datetime] = None

# For use by redispatch
def reset(self):
Expand All @@ -116,7 +116,7 @@ class ElectronSchema(BaseModel):
id: int
metadata: ElectronMetadata
assets: ElectronAssets
custom_assets: Optional[Dict[str, AssetSchema]]
custom_assets: Optional[Dict[str, AssetSchema]] = None

@validator("custom_assets")
def check_custom_asset_keys(cls, v):
Expand Down
2 changes: 1 addition & 1 deletion covalent/_shared_files/schemas/lattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class LatticeMetadata(BaseModel):
class LatticeSchema(BaseModel):
metadata: LatticeMetadata
assets: LatticeAssets
custom_assets: Optional[Dict[str, AssetSchema]]
custom_assets: Optional[Dict[str, AssetSchema]] = None

transport_graph: TransportGraphSchema

Expand Down
4 changes: 2 additions & 2 deletions covalent/_shared_files/schemas/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ class ResultMetadata(BaseModel):
dispatch_id: str
root_dispatch_id: str
status: StatusEnum
start_time: Optional[datetime]
end_time: Optional[datetime]
start_time: Optional[datetime] = None
end_time: Optional[datetime] = None

# For use by redispatch
def reset(self):
Expand Down

0 comments on commit d094429

Please sign in to comment.