{"action":"created","issue":{"url":"https://api.github.com/repos/SEED-platform/seed/issues/430","repository_url":"https://api.github.com/repos/SEED-platform/seed","labels_url":"https://api.github.com/repos/SEED-platform/seed/issues/430/labels{/name}","comments_url":"https://api.github.com/repos/SEED-platform/seed/issues/430/comments","events_url":"https://api.github.com/repos/SEED-platform/seed/issues/430/events","html_url":"https://github.com/SEED-platform/seed/issues/430","id":110738025,"number":430,"title":"Potential crash in map_row_chunk","user":{"login":"StephenCzarnecki","id":7605407,"avatar_url":"https://avatars3.githubusercontent.com/u/7605407?v=3","gravatar_id":"","url":"https://api.github.com/users/StephenCzarnecki","html_url":"https://github.com/StephenCzarnecki","followers_url":"https://api.github.com/users/StephenCzarnecki/followers","following_url":"https://api.github.com/users/StephenCzarnecki/following{/other_user}","gists_url":"https://api.github.com/users/StephenCzarnecki/gists{/gist_id}","starred_url":"https://api.github.com/users/StephenCzarnecki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StephenCzarnecki/subscriptions","organizations_url":"https://api.github.com/users/StephenCzarnecki/orgs","repos_url":"https://api.github.com/users/StephenCzarnecki/repos","events_url":"https://api.github.com/users/StephenCzarnecki/events{/privacy}","received_events_url":"https://api.github.com/users/StephenCzarnecki/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"StephenCzarnecki","id":7605407,"avatar_url":"https://avatars3.githubusercontent.com/u/7605407?v=3","gravatar_id":"","url":"https://api.github.com/users/StephenCzarnecki","html_url":"https://github.com/StephenCzarnecki","followers_url":"https://api.github.com/users/StephenCzarnecki/followers","following_url":"https://api.github.com/users/StephenCzarnecki/following{/other_user}","gists_url":"https://api.github.com/users/StephenCzarnecki/gists{/gist_id}","starred_url":"https://api.github.com/users/StephenCzarnecki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StephenCzarnecki/subscriptions","organizations_url":"https://api.github.com/users/StephenCzarnecki/orgs","repos_url":"https://api.github.com/users/StephenCzarnecki/repos","events_url":"https://api.github.com/users/StephenCzarnecki/events{/privacy}","received_events_url":"https://api.github.com/users/StephenCzarnecki/received_events","type":"User","site_admin":false},"assignees":[{"login":"StephenCzarnecki","id":7605407,"avatar_url":"https://avatars3.githubusercontent.com/u/7605407?v=3","gravatar_id":"","url":"https://api.github.com/users/StephenCzarnecki","html_url":"https://github.com/StephenCzarnecki","followers_url":"https://api.github.com/users/StephenCzarnecki/followers","following_url":"https://api.github.com/users/StephenCzarnecki/following{/other_user}","gists_url":"https://api.github.com/users/StephenCzarnecki/gists{/gist_id}","starred_url":"https://api.github.com/users/StephenCzarnecki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StephenCzarnecki/subscriptions","organizations_url":"https://api.github.com/users/StephenCzarnecki/orgs","repos_url":"https://api.github.com/users/StephenCzarnecki/repos","events_url":"https://api.github.com/users/StephenCzarnecki/events{/privacy}","received_events_url":"https://api.github.com/users/StephenCzarnecki/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/SEED-platform/seed/milestones/19","html_url":"https://github.com/SEED-platform/seed/milestone/19","labels_url":"https://api.github.com/repos/SEED-platform/seed/milestones/19/labels","id":1309144,"number":19,"title":"2016","description":"Issues we would like to tackle in 2016. Will have to be prioritized based on user need and funding.","creator":{"login":"RDmitchell","id":6314950,"avatar_url":"https://avatars1.githubusercontent.com/u/6314950?v=3","gravatar_id":"","url":"https://api.github.com/users/RDmitchell","html_url":"https://github.com/RDmitchell","followers_url":"https://api.github.com/users/RDmitchell/followers","following_url":"https://api.github.com/users/RDmitchell/following{/other_user}","gists_url":"https://api.github.com/users/RDmitchell/gists{/gist_id}","starred_url":"https://api.github.com/users/RDmitchell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RDmitchell/subscriptions","organizations_url":"https://api.github.com/users/RDmitchell/orgs","repos_url":"https://api.github.com/users/RDmitchell/repos","events_url":"https://api.github.com/users/RDmitchell/events{/privacy}","received_events_url":"https://api.github.com/users/RDmitchell/received_events","type":"User","site_admin":false},"open_issues":51,"closed_issues":19,"state":"open","created_at":"2015-09-16T19:47:53Z","updated_at":"2017-04-19T21:11:18Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2015-10-09T21:22:10Z","updated_at":"2017-04-19T21:11:18Z","closed_at":"2017-04-19T21:11:17Z","body":"In the following bit of code \"model\" is only created inside the for loop.  If chuck is empty then model will not exist and the \"if model:\" line will throw a \"name 'model' is not defined\"\n\n```\nfor row in chunk:\n    model = mapper.map_row(\n        row,\n        mapping,\n        BuildingSnapshot,\n        cleaner=map_cleaner,\n        concat=concats,\n        apply_columns=apply_columns,\n        apply_func=apply_func,\n        *args,\n        **kwargs\n    )\n\n    model.import_file = import_file\n    model.source_type = save_type\n    model.clean()\n    model.super_organization = import_file.import_record.super_organization\n    model.save()\nif model:\n    # Make sure that we've saved all of the extra_data column names\n    save_column_names(model, mapping=mapping)\n```\n"},"comment":{"url":"https://api.github.com/repos/SEED-platform/seed/issues/comments/295444760","html_url":"https://github.com/SEED-platform/seed/issues/430#issuecomment-295444760","issue_url":"https://api.github.com/repos/SEED-platform/seed/issues/430","id":295444760,"user":{"login":"nllong","id":1907354,"avatar_url":"https://avatars1.githubusercontent.com/u/1907354?v=3","gravatar_id":"","url":"https://api.github.com/users/nllong","html_url":"https://github.com/nllong","followers_url":"https://api.github.com/users/nllong/followers","following_url":"https://api.github.com/users/nllong/following{/other_user}","gists_url":"https://api.github.com/users/nllong/gists{/gist_id}","starred_url":"https://api.github.com/users/nllong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nllong/subscriptions","organizations_url":"https://api.github.com/users/nllong/orgs","repos_url":"https://api.github.com/users/nllong/repos","events_url":"https://api.github.com/users/nllong/events{/privacy}","received_events_url":"https://api.github.com/users/nllong/received_events","type":"User","site_admin":false},"created_at":"2017-04-19T21:11:17Z","updated_at":"2017-04-19T21:11:17Z","body":"no longer valid."}}
{"actor":{"display_login":"nllong"}}