Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1116)

Unified Diff: appengine/findit/model/wf_try_job.py

Issue 2147713002: [Findit] Make sure not use empty list or dict as default value. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: . Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/findit/model/wf_swarming_task.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/model/wf_try_job.py
diff --git a/appengine/findit/model/wf_try_job.py b/appengine/findit/model/wf_try_job.py
index a5f0b87c6ec3702659b206ffece4f3f849134e47..4736529bb6363e7d17faafccccf2339a95ebd3da 100644
--- a/appengine/findit/model/wf_try_job.py
+++ b/appengine/findit/model/wf_try_job.py
@@ -14,17 +14,17 @@ class WfTryJob(BaseBuildModel):
'Wf' is short for waterfall.
"""
# A list of dict containing results and urls of each try job for compile.
- compile_results = ndb.JsonProperty(default=[], indexed=False, compressed=True)
+ compile_results = ndb.JsonProperty(indexed=False, compressed=True)
# A list of dict containing results and urls of each try job for test.
- test_results = ndb.JsonProperty(default=[], indexed=False, compressed=True)
+ test_results = ndb.JsonProperty(indexed=False, compressed=True)
# The status of the try job.
status = ndb.IntegerProperty(
default=analysis_status.PENDING, indexed=False)
# A list of try job IDs associated with each try job for collecting metadata.
- try_job_ids = ndb.JsonProperty(default=[], indexed=False, compressed=True)
+ try_job_ids = ndb.JsonProperty(indexed=False, compressed=True)
@staticmethod
def _CreateKey(master_name, builder_name, build_number): # pragma: no cover
@@ -34,8 +34,12 @@ class WfTryJob(BaseBuildModel):
@staticmethod
def Create(master_name, builder_name, build_number): # pragma: no cover
- return WfTryJob(
+ try_job = WfTryJob(
key=WfTryJob._CreateKey(master_name, builder_name, build_number))
+ try_job.compile_results = try_job.compile_results or []
+ try_job.test_results = try_job.test_results or []
+ try_job.try_job_ids = try_job.try_job_ids or []
+ return try_job
@staticmethod
def Get(master_name, builder_name, build_number): # pragma: no cover
« no previous file with comments | « appengine/findit/model/wf_swarming_task.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698