{"action":"created","comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/27914152","id":27914152,"diff_hunk":"@@ -218,6 +219,25 @@ def test_check_array():\n     assert_true(isinstance(result, np.ndarray))\n \n \n+def test_check_array_pandas_dtype_object_conversion():\n+    # test that data-frame like objects with dtype object\n+    # get converted\n+    X = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]], dtype=np.object)\n+    X_df = MockDataFrame(X)\n+    assert_equal(check_array(X_df).dtype.kind, \"f\")\n+    assert_equal(check_array(X_df, ensure_2d=False).dtype.kind, \"f\")\n+    # smoke-test against dataframes with column named \"dtype\"\n+    X_df.dtype = \"Hans\"\n+    assert_equal(check_array(X_df, ensure_2d=False).dtype.kind, \"f\")","path":"sklearn/utils/tests/test_validation.py","position":21,"original_position":21,"commit_id":"89c1dc5488baf5a8a6b63c09a972ac07031a0f1e","original_commit_id":"da106d513e34b8bb0c189da6dfcd85781f84bd7d","user":{"login":"amueller","id":449558,"avatar_url":"https://avatars.githubusercontent.com/u/449558?v=3","gravatar_id":"","url":"https://api.github.com/users/amueller","html_url":"https://github.com/amueller","followers_url":"https://api.github.com/users/amueller/followers","following_url":"https://api.github.com/users/amueller/following{/other_user}","gists_url":"https://api.github.com/users/amueller/gists{/gist_id}","starred_url":"https://api.github.com/users/amueller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amueller/subscriptions","organizations_url":"https://api.github.com/users/amueller/orgs","repos_url":"https://api.github.com/users/amueller/repos","events_url":"https://api.github.com/users/amueller/events{/privacy}","received_events_url":"https://api.github.com/users/amueller/received_events","type":"User","site_admin":false},"body":"``check_array`` completely ignores the attribute. The MockDataFrame doesn't try to inspect ``self.__dict__`` so the array that is returned has nothing to do with \"Hans\". The issue I am smoke-testing is that ``check_array`` assumes a ``dtype`` object to be a numpy dtype and if it is not, it crashed.\r\nThe semantics I intended in this fix is that \"if dtype is no vaild dtype, then this thing is probably not a numpy array and we just try to convert it\".","created_at":"2015-04-07T20:01:29Z","updated_at":"2015-04-07T20:01:29Z","html_url":"https://github.com/scikit-learn/scikit-learn/pull/4541#discussion_r27914152","pull_request_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/4541","_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/27914152"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/4541#discussion_r27914152"},"pull_request":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/4541"}}},"pull_request":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/4541","id":32794582,"html_url":"https://github.com/scikit-learn/scikit-learn/pull/4541","diff_url":"https://github.com/scikit-learn/scikit-learn/pull/4541.diff","patch_url":"https://github.com/scikit-learn/scikit-learn/pull/4541.patch","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4541","number":4541,"state":"open","locked":false,"title":"[MRG] FIX be robust to columns name dtype, robust dtype checking","user":{"login":"amueller","id":449558,"avatar_url":"https://avatars.githubusercontent.com/u/449558?v=3","gravatar_id":"","url":"https://api.github.com/users/amueller","html_url":"https://github.com/amueller","followers_url":"https://api.github.com/users/amueller/followers","following_url":"https://api.github.com/users/amueller/following{/other_user}","gists_url":"https://api.github.com/users/amueller/gists{/gist_id}","starred_url":"https://api.github.com/users/amueller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amueller/subscriptions","organizations_url":"https://api.github.com/users/amueller/orgs","repos_url":"https://api.github.com/users/amueller/repos","events_url":"https://api.github.com/users/amueller/events{/privacy}","received_events_url":"https://api.github.com/users/amueller/received_events","type":"User","site_admin":false},"body":"Fixes #4540 and makes checks robust to thing holding dtype object data.","created_at":"2015-04-07T19:01:56Z","updated_at":"2015-04-07T20:01:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9b28b556a7ff251acfdd436a92e863fc600abd1b","assignee":null,"milestone":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/milestones/16","html_url":"https://github.com/scikit-learn/scikit-learn/milestones/0.16.1","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/milestones/16/labels","id":1054324,"number":16,"title":"0.16.1","description":null,"creator":{"login":"ogrisel","id":89061,"avatar_url":"https://avatars.githubusercontent.com/u/89061?v=3","gravatar_id":"","url":"https://api.github.com/users/ogrisel","html_url":"https://github.com/ogrisel","followers_url":"https://api.github.com/users/ogrisel/followers","following_url":"https://api.github.com/users/ogrisel/following{/other_user}","gists_url":"https://api.github.com/users/ogrisel/gists{/gist_id}","starred_url":"https://api.github.com/users/ogrisel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ogrisel/subscriptions","organizations_url":"https://api.github.com/users/ogrisel/orgs","repos_url":"https://api.github.com/users/ogrisel/repos","events_url":"https://api.github.com/users/ogrisel/events{/privacy}","received_events_url":"https://api.github.com/users/ogrisel/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":1,"state":"open","created_at":"2015-04-06T12:19:01Z","updated_at":"2015-04-07T19:03:10Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/4541/commits","review_comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/4541/comments","review_comment_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4541/comments","statuses_url":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/89c1dc5488baf5a8a6b63c09a972ac07031a0f1e","head":{"label":"amueller:robust_input_dtype_check","ref":"robust_input_dtype_check","sha":"89c1dc5488baf5a8a6b63c09a972ac07031a0f1e","user":{"login":"amueller","id":449558,"avatar_url":"https://avatars.githubusercontent.com/u/449558?v=3","gravatar_id":"","url":"https://api.github.com/users/amueller","html_url":"https://github.com/amueller","followers_url":"https://api.github.com/users/amueller/followers","following_url":"https://api.github.com/users/amueller/following{/other_user}","gists_url":"https://api.github.com/users/amueller/gists{/gist_id}","starred_url":"https://api.github.com/users/amueller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amueller/subscriptions","organizations_url":"https://api.github.com/users/amueller/orgs","repos_url":"https://api.github.com/users/amueller/repos","events_url":"https://api.github.com/users/amueller/events{/privacy}","received_events_url":"https://api.github.com/users/amueller/received_events","type":"User","site_admin":false},"repo":{"id":1622872,"name":"scikit-learn","full_name":"amueller/scikit-learn","owner":{"login":"amueller","id":449558,"avatar_url":"https://avatars.githubusercontent.com/u/449558?v=3","gravatar_id":"","url":"https://api.github.com/users/amueller","html_url":"https://github.com/amueller","followers_url":"https://api.github.com/users/amueller/followers","following_url":"https://api.github.com/users/amueller/following{/other_user}","gists_url":"https://api.github.com/users/amueller/gists{/gist_id}","starred_url":"https://api.github.com/users/amueller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amueller/subscriptions","organizations_url":"https://api.github.com/users/amueller/orgs","repos_url":"https://api.github.com/users/amueller/repos","events_url":"https://api.github.com/users/amueller/events{/privacy}","received_events_url":"https://api.github.com/users/amueller/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/amueller/scikit-learn","description":"scikit-learn main repo","fork":true,"url":"https://api.github.com/repos/amueller/scikit-learn","forks_url":"https://api.github.com/repos/amueller/scikit-learn/forks","keys_url":"https://api.github.com/repos/amueller/scikit-learn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amueller/scikit-learn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amueller/scikit-learn/teams","hooks_url":"https://api.github.com/repos/amueller/scikit-learn/hooks","issue_events_url":"https://api.github.com/repos/amueller/scikit-learn/issues/events{/number}","events_url":"https://api.github.com/repos/amueller/scikit-learn/events","assignees_url":"https://api.github.com/repos/amueller/scikit-learn/assignees{/user}","branches_url":"https://api.github.com/repos/amueller/scikit-learn/branches{/branch}","tags_url":"https://api.github.com/repos/amueller/scikit-learn/tags","blobs_url":"https://api.github.com/repos/amueller/scikit-learn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amueller/scikit-learn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amueller/scikit-learn/git/refs{/sha}","trees_url":"https://api.github.com/repos/amueller/scikit-learn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amueller/scikit-learn/statuses/{sha}","languages_url":"https://api.github.com/repos/amueller/scikit-learn/languages","stargazers_url":"https://api.github.com/repos/amueller/scikit-learn/stargazers","contributors_url":"https://api.github.com/repos/amueller/scikit-learn/contributors","subscribers_url":"https://api.github.com/repos/amueller/scikit-learn/subscribers","subscription_url":"https://api.github.com/repos/amueller/scikit-learn/subscription","commits_url":"https://api.github.com/repos/amueller/scikit-learn/commits{/sha}","git_commits_url":"https://api.github.com/repos/amueller/scikit-learn/git/commits{/sha}","comments_url":"https://api.github.com/repos/amueller/scikit-learn/comments{/number}","issue_comment_url":"https://api.github.com/repos/amueller/scikit-learn/issues/comments{/number}","contents_url":"https://api.github.com/repos/amueller/scikit-learn/contents/{+path}","compare_url":"https://api.github.com/repos/amueller/scikit-learn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amueller/scikit-learn/merges","archive_url":"https://api.github.com/repos/amueller/scikit-learn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amueller/scikit-learn/downloads","issues_url":"https://api.github.com/repos/amueller/scikit-learn/issues{/number}","pulls_url":"https://api.github.com/repos/amueller/scikit-learn/pulls{/number}","milestones_url":"https://api.github.com/repos/amueller/scikit-learn/milestones{/number}","notifications_url":"https://api.github.com/repos/amueller/scikit-learn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amueller/scikit-learn/labels{/name}","releases_url":"https://api.github.com/repos/amueller/scikit-learn/releases{/id}","created_at":"2011-04-16T12:41:21Z","updated_at":"2015-04-02T15:30:20Z","pushed_at":"2015-04-07T19:55:07Z","git_url":"git://github.com/amueller/scikit-learn.git","ssh_url":"git@github.com:amueller/scikit-learn.git","clone_url":"https://github.com/amueller/scikit-learn.git","svn_url":"https://github.com/amueller/scikit-learn","homepage":"http://scikit-learn.sourceforge.net","size":85384,"stargazers_count":6,"watchers_count":6,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"open_issues_count":0,"forks":3,"open_issues":0,"watchers":6,"default_branch":"master"}},"base":{"label":"scikit-learn:master","ref":"master","sha":"2305bdc7b97fa057e6b74e2a83db0ba782fc0891","user":{"login":"scikit-learn","id":365630,"avatar_url":"https://avatars.githubusercontent.com/u/365630?v=3","gravatar_id":"","url":"https://api.github.com/users/scikit-learn","html_url":"https://github.com/scikit-learn","followers_url":"https://api.github.com/users/scikit-learn/followers","following_url":"https://api.github.com/users/scikit-learn/following{/other_user}","gists_url":"https://api.github.com/users/scikit-learn/gists{/gist_id}","starred_url":"https://api.github.com/users/scikit-learn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scikit-learn/subscriptions","organizations_url":"https://api.github.com/users/scikit-learn/orgs","repos_url":"https://api.github.com/users/scikit-learn/repos","events_url":"https://api.github.com/users/scikit-learn/events{/privacy}","received_events_url":"https://api.github.com/users/scikit-learn/received_events","type":"Organization","site_admin":false},"repo":{"id":843222,"name":"scikit-learn","full_name":"scikit-learn/scikit-learn","owner":{"login":"scikit-learn","id":365630,"avatar_url":"https://avatars.githubusercontent.com/u/365630?v=3","gravatar_id":"","url":"https://api.github.com/users/scikit-learn","html_url":"https://github.com/scikit-learn","followers_url":"https://api.github.com/users/scikit-learn/followers","following_url":"https://api.github.com/users/scikit-learn/following{/other_user}","gists_url":"https://api.github.com/users/scikit-learn/gists{/gist_id}","starred_url":"https://api.github.com/users/scikit-learn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scikit-learn/subscriptions","organizations_url":"https://api.github.com/users/scikit-learn/orgs","repos_url":"https://api.github.com/users/scikit-learn/repos","events_url":"https://api.github.com/users/scikit-learn/events{/privacy}","received_events_url":"https://api.github.com/users/scikit-learn/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scikit-learn/scikit-learn","description":"scikit-learn: machine learning in Python","fork":false,"url":"https://api.github.com/repos/scikit-learn/scikit-learn","forks_url":"https://api.github.com/repos/scikit-learn/scikit-learn/forks","keys_url":"https://api.github.com/repos/scikit-learn/scikit-learn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scikit-learn/scikit-learn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scikit-learn/scikit-learn/teams","hooks_url":"https://api.github.com/repos/scikit-learn/scikit-learn/hooks","issue_events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/events{/number}","events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/events","assignees_url":"https://api.github.com/repos/scikit-learn/scikit-learn/assignees{/user}","branches_url":"https://api.github.com/repos/scikit-learn/scikit-learn/branches{/branch}","tags_url":"https://api.github.com/repos/scikit-learn/scikit-learn/tags","blobs_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/refs{/sha}","trees_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/{sha}","languages_url":"https://api.github.com/repos/scikit-learn/scikit-learn/languages","stargazers_url":"https://api.github.com/repos/scikit-learn/scikit-learn/stargazers","contributors_url":"https://api.github.com/repos/scikit-learn/scikit-learn/contributors","subscribers_url":"https://api.github.com/repos/scikit-learn/scikit-learn/subscribers","subscription_url":"https://api.github.com/repos/scikit-learn/scikit-learn/subscription","commits_url":"https://api.github.com/repos/scikit-learn/scikit-learn/commits{/sha}","git_commits_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/commits{/sha}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/comments{/number}","issue_comment_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/comments{/number}","contents_url":"https://api.github.com/repos/scikit-learn/scikit-learn/contents/{+path}","compare_url":"https://api.github.com/repos/scikit-learn/scikit-learn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scikit-learn/scikit-learn/merges","archive_url":"https://api.github.com/repos/scikit-learn/scikit-learn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scikit-learn/scikit-learn/downloads","issues_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues{/number}","pulls_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls{/number}","milestones_url":"https://api.github.com/repos/scikit-learn/scikit-learn/milestones{/number}","notifications_url":"https://api.github.com/repos/scikit-learn/scikit-learn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/labels{/name}","releases_url":"https://api.github.com/repos/scikit-learn/scikit-learn/releases{/id}","created_at":"2010-08-17T09:43:38Z","updated_at":"2015-04-07T16:52:02Z","pushed_at":"2015-04-07T19:55:10Z","git_url":"git://github.com/scikit-learn/scikit-learn.git","ssh_url":"git@github.com:scikit-learn/scikit-learn.git","clone_url":"https://github.com/scikit-learn/scikit-learn.git","svn_url":"https://github.com/scikit-learn/scikit-learn","homepage":"http://scikit-learn.org","size":122361,"stargazers_count":5509,"watchers_count":5509,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3286,"mirror_url":null,"open_issues_count":618,"forks":3286,"open_issues":618,"watchers":5509,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/4541"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/4541"},"issue":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4541"},"comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/4541/comments"},"review_comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/4541/comments"},"review_comment":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/4541/commits"},"statuses":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/89c1dc5488baf5a8a6b63c09a972ac07031a0f1e"}}}}