Skip line if NULL(Puthon)
Can yoy pls help me. I have code
run_list = []
count = 0
try:
for run in json['value']:
count+=1
Run_ID = run['id']
Name = run['name']
IsAutomated = run['isAutomated']
State = run['state']
Total_Tests = run['totalTests']
IncompleteTests = run['incompleteTests']
NotApplicableTests = run['notApplicableTests']
PassedTests = run['passedTests']
UnanalyzedTests = run['unanalyzedTests']
Revision = run['revision']
webAccessUrl = run['webAccessUrl']
StartedDate = run['startedDate']
CompletedDatef = json.get('completedDate','1999-01-01T00:00:00.523Z')
CompletedDate = run['completedDate']
ProjectSK = run['project']['id']
Url = run['url']
State = run['state']
#result = {'Run_ID':Run_ID, 'Run_Name': Name, 'IsAutomated' : IsAutomated, 'Total_Tests' : Total_Tests, 'IncompleteTests' : IncompleteTests, 'NotApplicableTests' : NotApplicableTests, 'PassedTests' : PassedTests, 'UnanalyzedTests' : UnanalyzedTests,'Revision' : Revision ,'webAccessUrl' : webAccessUrl, 'StartedDate' : StartedDate, 'CompletedDate' : CompletedDate, 'ProjectSK' : ProjectSK, 'Url' : Url, 'State' : State}
result = {'Run_ID':Run_ID,'Run_Name':Name,'IsAutomated':IsAutomated,'Total_Tests':Total_Tests,'IncompleteTests':IncompleteTests,'NotApplicableTests':NotApplicableTests,'PassedTests':PassedTests,'UnanalyzedTests':UnanalyzedTests,'Revision':Revision,'webAccessUrl':webAccessUrl,'StartedDate':StartedDate,'CompletedDate':CompletedDate,'ProjectSK':ProjectSK,'Url':Url,'State':State}
run_list.append(result)
#print(run_list)
#print(str(count) + " " + str(Run_ID) + " CompletedDate "+ str(CompletedDate)+ " CompletedDatef " +str(CompletedDatef))
except:
#type(CompletedDate)
pass
print(str(count) + " " + str(Run_ID) + " CompletedDate "+ str(CompletedDate)+ " CompletedDatef " +str(CompletedDatef))
After exec him i see that CompletedDate is null and cycle break. Can you tell me pls how can i skip line with NULL?