{"action":"created","comment":{"url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/pulls/comments/54920678","id":54920678,"diff_hunk":"@@ -256,6 +284,67 @@ def getColumnId(self, fieldName, fileId):\n         Returns:\n             ID for file column if found, otherwise raises exception\n         \"\"\"\n-        column = self.session.query(FileColumn).filter(FileColumn.name == fieldName.lower()).filter(FileColumn.file_id == fileId).all()\n-        self.checkUnique(column,\"No field found with that name for that file type\", \"Multiple fields with that name for that file type\")\n-        return column[0].file_column_id\n+        fileId = self.getFileId(fileType)\n+        column = self.session.query(FileColumn).filter(FileColumn.name == fieldName.lower()).filter(FileColumn.file_id == fileId)\n+        return self.runUniqueQuery(column,\"No field found with that name for that file type\", \"Multiple fields with that name for that file type\").file_column_id\n+\n+    def getColumnLength(self,fieldName, fileId):\n+        \"\"\" If there is a length rule for this field, return the max length.  Otherwise, return None. \"\"\"\n+        columnId = self.getColumnId(fieldName,fileId)\n+        # Get length rules for this column\n+        query = self.session.query(Rule).filter(Rule.file_column_id == columnId).filter(Rule.rule_type_id == 6)\n+        try:\n+            rule = self.runUniqueQuery(query,False,\"Multiple length rules for this column\")\n+        except NoResultFound as e:\n+            # No length rule for this column\n+            return None\n+        return int(float(rule.rule_text_1)) # Going through float in case of decimal value\n+\n+    def getRuleType(self,typeName):\n+        if(RuleType.TYPE_DICT == None):\n+            RuleType.TYPE_DICT = {}\n+            # Pull status values out of DB\n+            for ruleType in RuleType.TYPE_LIST:\n+                RuleType.TYPE_DICT[ruleType] = self.setRuleType(ruleType)\n+        if(not typeName in RuleType.TYPE_DICT):\n+            raise ValueError(\"Not a valid rule type\")\n+        return RuleType.TYPE_DICT[typeName]\n+\n+    def setRuleType(self,name):\n+        \"\"\"  Get an id for specified type, if not unique throw an exception\n+\n+        Arguments:\n+        name -- Name of type to get an id for\n+\n+        Returns:\n+        type_id of the specified type\n+        \"\"\"\n+        queryResult = self.session.query(RuleType.rule_type_id).filter(RuleType.name==name).one()\n+        return queryResult.rule_type_id\n+\n+    def getMultiFieldRuleType(self,typeName):","path":"dataactvalidator/interfaces/validatorValidationInterface.py","position":178,"original_position":178,"commit_id":"c1895c5c19f413c75c489270018bac2ef8807be5","original_commit_id":"c1895c5c19f413c75c489270018bac2ef8807be5","user":{"login":"jworcestBAH","id":11858333,"avatar_url":"https://avatars.githubusercontent.com/u/11858333?v=3","gravatar_id":"","url":"https://api.github.com/users/jworcestBAH","html_url":"https://github.com/jworcestBAH","followers_url":"https://api.github.com/users/jworcestBAH/followers","following_url":"https://api.github.com/users/jworcestBAH/following{/other_user}","gists_url":"https://api.github.com/users/jworcestBAH/gists{/gist_id}","starred_url":"https://api.github.com/users/jworcestBAH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jworcestBAH/subscriptions","organizations_url":"https://api.github.com/users/jworcestBAH/orgs","repos_url":"https://api.github.com/users/jworcestBAH/repos","events_url":"https://api.github.com/users/jworcestBAH/events{/privacy}","received_events_url":"https://api.github.com/users/jworcestBAH/received_events","type":"User","site_admin":false},"body":"Added","created_at":"2016-03-03T18:06:04Z","updated_at":"2016-03-03T18:06:04Z","html_url":"https://github.com/fedspendingtransparency/data-act-validator/pull/2#discussion_r54920678","pull_request_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/pulls/comments/54920678"},"html":{"href":"https://github.com/fedspendingtransparency/data-act-validator/pull/2#discussion_r54920678"},"pull_request":{"href":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/pulls/2","id":61461014,"html_url":"https://github.com/fedspendingtransparency/data-act-validator/pull/2","diff_url":"https://github.com/fedspendingtransparency/data-act-validator/pull/2.diff","patch_url":"https://github.com/fedspendingtransparency/data-act-validator/pull/2.patch","issue_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/issues/2","number":2,"state":"open","locked":false,"title":"Pull review changes","user":{"login":"jworcestBAH","id":11858333,"avatar_url":"https://avatars.githubusercontent.com/u/11858333?v=3","gravatar_id":"","url":"https://api.github.com/users/jworcestBAH","html_url":"https://github.com/jworcestBAH","followers_url":"https://api.github.com/users/jworcestBAH/followers","following_url":"https://api.github.com/users/jworcestBAH/following{/other_user}","gists_url":"https://api.github.com/users/jworcestBAH/gists{/gist_id}","starred_url":"https://api.github.com/users/jworcestBAH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jworcestBAH/subscriptions","organizations_url":"https://api.github.com/users/jworcestBAH/orgs","repos_url":"https://api.github.com/users/jworcestBAH/repos","events_url":"https://api.github.com/users/jworcestBAH/events{/privacy}","received_events_url":"https://api.github.com/users/jworcestBAH/received_events","type":"User","site_admin":false},"body":"Sprint 7 changes, primarily refactoring based on comments from last pull request.","created_at":"2016-03-02T20:23:16Z","updated_at":"2016-03-03T18:06:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8f73c98be53b1e6285b9c93110f317ea4f1f1fef","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/pulls/2/commits","review_comments_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/pulls/2/comments","review_comment_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/issues/2/comments","statuses_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/statuses/c1895c5c19f413c75c489270018bac2ef8807be5","head":{"label":"fedspendingtransparency:pull_review_changes","ref":"pull_review_changes","sha":"c1895c5c19f413c75c489270018bac2ef8807be5","user":{"login":"fedspendingtransparency","id":8397762,"avatar_url":"https://avatars.githubusercontent.com/u/8397762?v=3","gravatar_id":"","url":"https://api.github.com/users/fedspendingtransparency","html_url":"https://github.com/fedspendingtransparency","followers_url":"https://api.github.com/users/fedspendingtransparency/followers","following_url":"https://api.github.com/users/fedspendingtransparency/following{/other_user}","gists_url":"https://api.github.com/users/fedspendingtransparency/gists{/gist_id}","starred_url":"https://api.github.com/users/fedspendingtransparency/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fedspendingtransparency/subscriptions","organizations_url":"https://api.github.com/users/fedspendingtransparency/orgs","repos_url":"https://api.github.com/users/fedspendingtransparency/repos","events_url":"https://api.github.com/users/fedspendingtransparency/events{/privacy}","received_events_url":"https://api.github.com/users/fedspendingtransparency/received_events","type":"Organization","site_admin":false},"repo":{"id":47648589,"name":"data-act-validator","full_name":"fedspendingtransparency/data-act-validator","owner":{"login":"fedspendingtransparency","id":8397762,"avatar_url":"https://avatars.githubusercontent.com/u/8397762?v=3","gravatar_id":"","url":"https://api.github.com/users/fedspendingtransparency","html_url":"https://github.com/fedspendingtransparency","followers_url":"https://api.github.com/users/fedspendingtransparency/followers","following_url":"https://api.github.com/users/fedspendingtransparency/following{/other_user}","gists_url":"https://api.github.com/users/fedspendingtransparency/gists{/gist_id}","starred_url":"https://api.github.com/users/fedspendingtransparency/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fedspendingtransparency/subscriptions","organizations_url":"https://api.github.com/users/fedspendingtransparency/orgs","repos_url":"https://api.github.com/users/fedspendingtransparency/repos","events_url":"https://api.github.com/users/fedspendingtransparency/events{/privacy}","received_events_url":"https://api.github.com/users/fedspendingtransparency/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fedspendingtransparency/data-act-validator","description":"","fork":false,"url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator","forks_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/forks","keys_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/teams","hooks_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/hooks","issue_events_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/issues/events{/number}","events_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/events","assignees_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/assignees{/user}","branches_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/branches{/branch}","tags_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/tags","blobs_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/git/refs{/sha}","trees_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/statuses/{sha}","languages_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/languages","stargazers_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/stargazers","contributors_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/contributors","subscribers_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/subscribers","subscription_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/subscription","commits_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/commits{/sha}","git_commits_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/git/commits{/sha}","comments_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/comments{/number}","issue_comment_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/issues/comments{/number}","contents_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/contents/{+path}","compare_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/merges","archive_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/downloads","issues_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/issues{/number}","pulls_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/pulls{/number}","milestones_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/milestones{/number}","notifications_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/labels{/name}","releases_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/releases{/id}","deployments_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/deployments","created_at":"2015-12-08T20:45:56Z","updated_at":"2016-03-01T03:18:18Z","pushed_at":"2016-03-02T20:23:17Z","git_url":"git://github.com/fedspendingtransparency/data-act-validator.git","ssh_url":"git@github.com:fedspendingtransparency/data-act-validator.git","clone_url":"https://github.com/fedspendingtransparency/data-act-validator.git","svn_url":"https://github.com/fedspendingtransparency/data-act-validator","homepage":null,"size":2502,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":2,"default_branch":"master"}},"base":{"label":"fedspendingtransparency:development","ref":"development","sha":"004af04a2ec9deee9caaeac2ad93d9a0686133dd","user":{"login":"fedspendingtransparency","id":8397762,"avatar_url":"https://avatars.githubusercontent.com/u/8397762?v=3","gravatar_id":"","url":"https://api.github.com/users/fedspendingtransparency","html_url":"https://github.com/fedspendingtransparency","followers_url":"https://api.github.com/users/fedspendingtransparency/followers","following_url":"https://api.github.com/users/fedspendingtransparency/following{/other_user}","gists_url":"https://api.github.com/users/fedspendingtransparency/gists{/gist_id}","starred_url":"https://api.github.com/users/fedspendingtransparency/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fedspendingtransparency/subscriptions","organizations_url":"https://api.github.com/users/fedspendingtransparency/orgs","repos_url":"https://api.github.com/users/fedspendingtransparency/repos","events_url":"https://api.github.com/users/fedspendingtransparency/events{/privacy}","received_events_url":"https://api.github.com/users/fedspendingtransparency/received_events","type":"Organization","site_admin":false},"repo":{"id":47648589,"name":"data-act-validator","full_name":"fedspendingtransparency/data-act-validator","owner":{"login":"fedspendingtransparency","id":8397762,"avatar_url":"https://avatars.githubusercontent.com/u/8397762?v=3","gravatar_id":"","url":"https://api.github.com/users/fedspendingtransparency","html_url":"https://github.com/fedspendingtransparency","followers_url":"https://api.github.com/users/fedspendingtransparency/followers","following_url":"https://api.github.com/users/fedspendingtransparency/following{/other_user}","gists_url":"https://api.github.com/users/fedspendingtransparency/gists{/gist_id}","starred_url":"https://api.github.com/users/fedspendingtransparency/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fedspendingtransparency/subscriptions","organizations_url":"https://api.github.com/users/fedspendingtransparency/orgs","repos_url":"https://api.github.com/users/fedspendingtransparency/repos","events_url":"https://api.github.com/users/fedspendingtransparency/events{/privacy}","received_events_url":"https://api.github.com/users/fedspendingtransparency/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fedspendingtransparency/data-act-validator","description":"","fork":false,"url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator","forks_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/forks","keys_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/teams","hooks_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/hooks","issue_events_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/issues/events{/number}","events_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/events","assignees_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/assignees{/user}","branches_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/branches{/branch}","tags_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/tags","blobs_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/git/refs{/sha}","trees_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/statuses/{sha}","languages_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/languages","stargazers_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/stargazers","contributors_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/contributors","subscribers_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/subscribers","subscription_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/subscription","commits_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/commits{/sha}","git_commits_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/git/commits{/sha}","comments_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/comments{/number}","issue_comment_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/issues/comments{/number}","contents_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/contents/{+path}","compare_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/merges","archive_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/downloads","issues_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/issues{/number}","pulls_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/pulls{/number}","milestones_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/milestones{/number}","notifications_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/labels{/name}","releases_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/releases{/id}","deployments_url":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/deployments","created_at":"2015-12-08T20:45:56Z","updated_at":"2016-03-01T03:18:18Z","pushed_at":"2016-03-02T20:23:17Z","git_url":"git://github.com/fedspendingtransparency/data-act-validator.git","ssh_url":"git@github.com:fedspendingtransparency/data-act-validator.git","clone_url":"https://github.com/fedspendingtransparency/data-act-validator.git","svn_url":"https://github.com/fedspendingtransparency/data-act-validator","homepage":null,"size":2502,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/pulls/2"},"html":{"href":"https://github.com/fedspendingtransparency/data-act-validator/pull/2"},"issue":{"href":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/issues/2"},"comments":{"href":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/fedspendingtransparency/data-act-validator/statuses/c1895c5c19f413c75c489270018bac2ef8807be5"}}}}