@@ -128,33 +128,33 @@ def as_dict(self) -> Dict:
128128 'children' : [],
129129 'files' : task_files ,
130130 }
131- if self .runtime :
131+ if self .runtime is not None :
132132 task_obj ['runtimeInSeconds' ] = self .runtime
133- if self .cores :
133+ if self .cores is not None :
134134 task_obj ['cores' ] = self .cores
135- if self .task_id :
135+ if self .task_id is not None :
136136 task_obj ['id' ] = self .task_id
137- if self .category :
137+ if self .category is not None :
138138 task_obj ['category' ] = self .category
139- if self .avg_cpu :
139+ if self .avg_cpu is not None :
140140 task_obj ['avgCPU' ] = self .avg_cpu
141- if self .bytes_read :
141+ if self .bytes_read is not None :
142142 task_obj ['readBytes' ] = self .bytes_read
143- if self .bytes_written :
143+ if self .bytes_written is not None :
144144 task_obj ['writtenBytes' ] = self .bytes_written
145- if self .memory :
145+ if self .memory is not None :
146146 task_obj ['memoryInBytes' ] = self .memory
147- if self .energy :
147+ if self .energy is not None :
148148 task_obj ['energy' ] = self .energy
149- if self .avg_power :
149+ if self .avg_power is not None :
150150 task_obj ['avgPower' ] = self .avg_power
151- if self .priority :
151+ if self .priority is not None :
152152 task_obj ['priority' ] = self .priority
153- if self .program :
153+ if self .program is not None :
154154 task_obj ['command' ]['program' ] = self .program
155- if self .args :
155+ if self .args is not None :
156156 task_obj ['command' ]['arguments' ] = self .args
157- if self .machine :
157+ if self .machine is not None :
158158 task_obj ['machine' ] = self .machine .name
159159
160160 return task_obj
0 commit comments