File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change
1
+ from datetime import datetime
1
2
from typing import Union
2
3
3
4
from .base_types import LanguageAlias , Status
@@ -125,11 +126,21 @@ def set_attributes(self, attributes):
125
126
continue
126
127
127
128
if attr in ENCODED_FIELDS :
128
- setattr ( self , attr , decode (value ) if value else None )
129
+ value = decode (value ) if value else None
129
130
elif attr == "status" :
130
- self .status = Status (value ["id" ])
131
- else :
132
- setattr (self , attr , value )
131
+ value = Status (value ["id" ])
132
+ elif attr in ("created_at" , "finished_at" ):
133
+ value = datetime .strptime (value , "%Y-%m-%dT%H:%M:%S.%fZ" )
134
+ elif attr in (
135
+ "wall_time" ,
136
+ "wall_time_limit" ,
137
+ "cpu_extra_time" ,
138
+ "cpu_time_limit" ,
139
+ "time" ,
140
+ ):
141
+ value = float (value )
142
+
143
+ setattr (self , attr , value )
133
144
134
145
# TODO: Rename to as_body that accepts a Client.
135
146
def to_dict (self , client : "Client" ) -> dict :
You can’t perform that action at this time.
0 commit comments