Import Error: Unit Handling

Issue #29 resolved
Paul Stasiuk repo owner created an issue

For some reason a row like this is failing on units:

failure structure is: [{'medium': None, 'description': None, u'unitname': 'ug/l', 'pfail': True, 'altitude': None, 'unitid': 0, 'ufail': True, 'sampleid': None, 'parameterid': 0, 'insertid': 175, 'siteid': 723, 'unit': 'Calcium', 'time': '0.494444444444', 'date': '2004-03-10 00:00:00', 'concentration': '36000.0', u'sourcesiteid': '11S', 'sfail': False, u'altname': 'Calcium'}]

Comments (3)

  1. Paul Stasiuk reporter

    Well, first of all,

                    if map_label == 'unitname':
                        #print 'Checking units'
                        unit_id = check_unit_exists(value.strip())
    
                        if unit_id != 0:
                            proceed_with_insertion['unit'] = True
                            data_row['unitid'] = unit_id
                            data_row['unit'] = value.strip()
                            data_row['ufail'] = False
    
                        else:
                            unit_failures = unit_failures
                            proceed_with_insertion['unit'] = False
                            data_row['unitid'] = unit_id
                            data_row['unit'] = value.strip()
                            data_row['ufail'] = True
    

    Does not function properly, because check_unit_exists has not been imported into that script. Went ahead and imported that.

  2. Log in to comment