# Add check for flag in schema before accessing

XMLWordPrintable

#### Details

• Type: Bug
• Status: Done
• Resolution: Done
• Fix Version/s: None
• Component/s:
• Labels:
None
• Story Points:
0.25
• Sprint:
DRP F18-2
• Team:
Data Release Production

#### Description

A bug affecting visitAnalysis.py was introduced on DM-14874 where culling of duplicate and sky objects was made.  The latter are only added in at the coadd level, so a check for the existence of this field should be made prior to accessing it to avoid the following failure:

 KeyError: "Field with name 'merge_peak_sky' not found"

#### Activity

Hide
Lauren MacArthur added a comment -

Would you mind giving this bug fix a quick look?  I can confirm all 5 scripts work with this fix.

Show
Lauren MacArthur added a comment - Would you mind giving this bug fix a quick look?  I can confirm all 5 scripts work with this fix.
Hide
Tim Morton [X] (Inactive) added a comment -

Yup, looks like a good fix to me! (I'm assuming it's just the one one-liner commit.)

Show
Tim Morton [X] (Inactive) added a comment - Yup, looks like a good fix to me! (I'm assuming it's just the one one-liner commit.)
Hide
Lauren MacArthur added a comment -

Indeed...sorry I forgot to make the PR...it’s there now. Will merge tomorrow. Thanks for the quick review!

Show
Lauren MacArthur added a comment - Indeed...sorry I forgot to make the PR...it’s there now. Will merge tomorrow. Thanks for the quick review!

#### People

Assignee:
Lauren MacArthur
Reporter:
Lauren MacArthur
Reviewers:
Tim Morton [X] (Inactive)
Watchers:
Lauren MacArthur, Tim Morton [X] (Inactive)