{"action":"created","issue":{"url":"https://api.github.com/repos/pydata/pandas/issues/8883","labels_url":"https://api.github.com/repos/pydata/pandas/issues/8883/labels{/name}","comments_url":"https://api.github.com/repos/pydata/pandas/issues/8883/comments","events_url":"https://api.github.com/repos/pydata/pandas/issues/8883/events","html_url":"https://github.com/pydata/pandas/pull/8883","id":49841803,"number":8883,"title":"REF: refactor **kwargs usage","user":{"login":"behzadnouri","id":1288998,"avatar_url":"https://avatars.githubusercontent.com/u/1288998?v=3","gravatar_id":"","url":"https://api.github.com/users/behzadnouri","html_url":"https://github.com/behzadnouri","followers_url":"https://api.github.com/users/behzadnouri/followers","following_url":"https://api.github.com/users/behzadnouri/following{/other_user}","gists_url":"https://api.github.com/users/behzadnouri/gists{/gist_id}","starred_url":"https://api.github.com/users/behzadnouri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/behzadnouri/subscriptions","organizations_url":"https://api.github.com/users/behzadnouri/orgs","repos_url":"https://api.github.com/users/behzadnouri/repos","events_url":"https://api.github.com/users/behzadnouri/events{/privacy}","received_events_url":"https://api.github.com/users/behzadnouri/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pydata/pandas/labels/API%20Design","name":"API Design","color":"AD7FA8"},{"url":"https://api.github.com/repos/pydata/pandas/labels/Error%20Reporting","name":"Error Reporting","color":"ffa0ff"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/pydata/pandas/milestones/25","html_url":"https://github.com/pydata/pandas/milestones/0.16.0","labels_url":"https://api.github.com/repos/pydata/pandas/milestones/25/labels","id":569113,"number":25,"title":"0.16.0","description":"after 0.15 of course!","creator":{"login":"jreback","id":953992,"avatar_url":"https://avatars.githubusercontent.com/u/953992?v=3","gravatar_id":"","url":"https://api.github.com/users/jreback","html_url":"https://github.com/jreback","followers_url":"https://api.github.com/users/jreback/followers","following_url":"https://api.github.com/users/jreback/following{/other_user}","gists_url":"https://api.github.com/users/jreback/gists{/gist_id}","starred_url":"https://api.github.com/users/jreback/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jreback/subscriptions","organizations_url":"https://api.github.com/users/jreback/orgs","repos_url":"https://api.github.com/users/jreback/repos","events_url":"https://api.github.com/users/jreback/events{/privacy}","received_events_url":"https://api.github.com/users/jreback/received_events","type":"User","site_admin":false},"open_issues":546,"closed_issues":319,"state":"open","created_at":"2014-02-14T03:31:22Z","updated_at":"2015-03-04T20:42:39Z","due_on":"2015-03-10T04:00:00Z","closed_at":null},"comments":5,"created_at":"2014-11-23T22:20:35Z","updated_at":"2015-03-04T20:42:39Z","closed_at":"2015-03-04T20:42:39Z","pull_request":{"url":"https://api.github.com/repos/pydata/pandas/pulls/8883","html_url":"https://github.com/pydata/pandas/pull/8883","diff_url":"https://github.com/pydata/pandas/pull/8883.diff","patch_url":"https://github.com/pydata/pandas/pull/8883.patch"},"body":"related issue: https://github.com/pydata/pandas/issues/8597. \r\n\r\namong changes:\r\n\r\n[tests/test_generic.py](https://github.com/pydata/pandas/blob/0a2ea0ac39a74771d54b91522728f6092b0ef897/pandas/tests/test_generic.py#L603) `downcast` is misspelled `donwcast`, but no error is raised, because of how `**kwargs` is used.\r\n\r\n[core/categorical.py:sort](https://github.com/pydata/pandas/blob/0a2ea0ac39a74771d54b91522728f6092b0ef897/pandas/core/categorical.py#L945) `na_position` is not passed to `self.order`.\r\n\r\n[core/categorical.py:fillna](https://github.com/pydata/pandas/blob/0a2ea0ac39a74771d54b91522728f6092b0ef897/pandas/core/categorical.py#L981) `Categorical.fillna` does not support `inplace` as opposed to say `Series.fillna` or `DataFrame.fillna`, but `**kwargs` being there causes below code to just silently ignore passed argument:\r\n\r\n    >>> ca = pd.Categorical([0, 0, 2, 2, 3, np.nan])\r\n    >>> ca.fillna(0, inplace=True)\r\n    [0, 0, 2, 2, 3, 0]\r\n    Categories (3, int64): [0 < 2 < 3]\r\n    >>> ca\r\n    [0, 0, 2, 2, 3, NaN]\r\n    Categories (3, int64): [0 < 2 < 3]\r\n\r\n[This test](https://github.com/pydata/pandas/blob/0a2ea0ac39a74771d54b91522728f6092b0ef897/pandas/tests/test_groupby.py#L4418) is basically testing that you can specify _any_ keyword argument and it is just silently ignored. I cannot think of any case that this would be a good idea, or has any use case.\r\n\r\nmultiple instances where `*args` or `*kwargs` are not passed to inner function or have any use at all, as can be seen in the PR diff.\r\n"},"comment":{"url":"https://api.github.com/repos/pydata/pandas/issues/comments/77242789","html_url":"https://github.com/pydata/pandas/pull/8883#issuecomment-77242789","issue_url":"https://api.github.com/repos/pydata/pandas/issues/8883","id":77242789,"user":{"login":"jreback","id":953992,"avatar_url":"https://avatars.githubusercontent.com/u/953992?v=3","gravatar_id":"","url":"https://api.github.com/users/jreback","html_url":"https://github.com/jreback","followers_url":"https://api.github.com/users/jreback/followers","following_url":"https://api.github.com/users/jreback/following{/other_user}","gists_url":"https://api.github.com/users/jreback/gists{/gist_id}","starred_url":"https://api.github.com/users/jreback/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jreback/subscriptions","organizations_url":"https://api.github.com/users/jreback/orgs","repos_url":"https://api.github.com/users/jreback/repos","events_url":"https://api.github.com/users/jreback/events{/privacy}","received_events_url":"https://api.github.com/users/jreback/received_events","type":"User","site_admin":false},"created_at":"2015-03-04T20:42:39Z","updated_at":"2015-03-04T20:42:39Z","body":"merged via https://github.com/pydata/pandas/commit/38021ca83d5c85d27236ebc04865f936d2a82f99\r\n\r\nthanks!"}}