{"action":"opened","number":364,"pull_request":{"url":"https://api.github.com/repos/influxdata/influxdb-python/pulls/364","id":83164179,"html_url":"https://github.com/influxdata/influxdb-python/pull/364","diff_url":"https://github.com/influxdata/influxdb-python/pull/364.diff","patch_url":"https://github.com/influxdata/influxdb-python/pull/364.patch","issue_url":"https://api.github.com/repos/influxdata/influxdb-python/issues/364","number":364,"state":"open","locked":false,"title":"Dataframe client support for (i) tag columns and (ii) direct conversion to line protocol","user":{"login":"mdbartos","id":8175317,"avatar_url":"https://avatars.githubusercontent.com/u/8175317?v=3","gravatar_id":"","url":"https://api.github.com/users/mdbartos","html_url":"https://github.com/mdbartos","followers_url":"https://api.github.com/users/mdbartos/followers","following_url":"https://api.github.com/users/mdbartos/following{/other_user}","gists_url":"https://api.github.com/users/mdbartos/gists{/gist_id}","starred_url":"https://api.github.com/users/mdbartos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdbartos/subscriptions","organizations_url":"https://api.github.com/users/mdbartos/orgs","repos_url":"https://api.github.com/users/mdbartos/repos","events_url":"https://api.github.com/users/mdbartos/events{/privacy}","received_events_url":"https://api.github.com/users/mdbartos/received_events","type":"User","site_admin":false},"body":"This pull request addresses issues #362 and #363.\r\n\r\n+ `tag_columns` and `field_columns` can now be specified in the `write_points` method, allowing some columns to be treated as tags and others to be treated as fields. Global tags can still be specified using the `tags` keyword argument (meaning that this change shouldn't break any old code).\r\n\r\n+ Dataframes are now converted directly to line protocol. This results in a ~5x speed boost compared to the old method.\r\n\r\n+ To get all tox tests to pass on influxdb v0.13, I had to make some changes to retention policy format in `client_test_with_server.py`. This should maintain backwards compatibility with v0.9, however.\r\n\r\nAdditions:\r\n+ `_dataframe_client.py`\r\n    + new functions:\r\n        + `_convert_dataframe_to_lines`: Converts dataframe to line protocol.\r\n        + `_stringify_dataframe`: Helper function for converting dataframe to string type.\r\n    + changed functions:\r\n        + `write_points`: Added protocol ('line' or 'json') and numeric precision keyword args. \r\n        + `_convert_dataframe_to_json`: Tag columns can now be specified.\r\n+ `client.py`\r\n    + changed functions:\r\n        + `write`: Added protocol ('line' or 'json') keyword arg, and support for direct line protocol.\r\n        + `write_points`: Same as write.\r\n        + `_write_points`: Same as write.\r\n        + `send_packet`: Same as write.\r\n+ `dataframe_client_test.py`\r\n    + new functions:\r\n        + `test_write_points_with_tag_columns`: Self-explanatory.\r\n        + `test_write_points_with_tag_columns_and_global_tags`: Self-explanatory.\r\n        + `test_write_points_with_tag_columns_and_defaults`: Tests default behavior (i.e. when tag columns are specified, but field columns aren't, etc.)\r\n    + changed functions:\r\n        + `(all tests)`: In `expected_response`, order of tags/fields was changed to match the order they appear in the dataframe (for more consistent testing) \r\n+ `misc.py`\r\n    + new functions:\r\n        + `find_influxd_path`: Needed for v0.13 support in `client_test_with_server.py`\r\n+ `client_test_with_server.py`\r\n    + changes: Detect version (0.9 vs. 0.13). If 0.13, retention policy duration should be '0s' instead of '0'.\r\n\r\nTag/field columns default behavior:\r\n\r\n+ If neither tag columns nor field columns are specified, all columns are assumed to be field columns (this is consistent with previous behavior).\r\n\r\n+ If tag columns are specified, but no field columns are specified, all column names not included in tag columns are assumed to be field columns.\r\n\r\n+ If tag columns are not specified, but field columns are specified, all column names not included in field columns are assumed to be tag columns.\r\n\r\n+ If tag columns and field columns are specified, only those columns included in tag columns or field columns are included in the write.\r\n\r\n+ See `dataframe_client_test/test_write_points_with_tag_columns_and_defaults` for examples of expected behavior.\r\n\r\nMinor issues:\r\n+ `find_influxd_path` was duplicated from `influxdb_instance.py` into `misc.py`. Probably not best practice, but I needed to do this to get the tests to work with influxdb v0.13.\r\n+ Haven't tested with older versions of pandas.\r\n+ I left `_convert_dataframe_to_json` in for the time being, but it can probably be removed.\r\n\r\nWhen you get time to review, please let me know if you have any questions or concerns.\r\n\r\nThanks,\r\nMDB","created_at":"2016-08-29T20:43:11Z","updated_at":"2016-08-29T20:43:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/influxdata/influxdb-python/pulls/364/commits","review_comments_url":"https://api.github.com/repos/influxdata/influxdb-python/pulls/364/comments","review_comment_url":"https://api.github.com/repos/influxdata/influxdb-python/pulls/comments{/number}","comments_url":"https://api.github.com/repos/influxdata/influxdb-python/issues/364/comments","statuses_url":"https://api.github.com/repos/influxdata/influxdb-python/statuses/1af9d4e8eb6b9294e85c91196c107be3d5045f71","head":{"label":"mdbartos:master","ref":"master","sha":"1af9d4e8eb6b9294e85c91196c107be3d5045f71","user":{"login":"mdbartos","id":8175317,"avatar_url":"https://avatars.githubusercontent.com/u/8175317?v=3","gravatar_id":"","url":"https://api.github.com/users/mdbartos","html_url":"https://github.com/mdbartos","followers_url":"https://api.github.com/users/mdbartos/followers","following_url":"https://api.github.com/users/mdbartos/following{/other_user}","gists_url":"https://api.github.com/users/mdbartos/gists{/gist_id}","starred_url":"https://api.github.com/users/mdbartos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdbartos/subscriptions","organizations_url":"https://api.github.com/users/mdbartos/orgs","repos_url":"https://api.github.com/users/mdbartos/repos","events_url":"https://api.github.com/users/mdbartos/events{/privacy}","received_events_url":"https://api.github.com/users/mdbartos/received_events","type":"User","site_admin":false},"repo":{"id":66315939,"name":"influxdb-python","full_name":"mdbartos/influxdb-python","owner":{"login":"mdbartos","id":8175317,"avatar_url":"https://avatars.githubusercontent.com/u/8175317?v=3","gravatar_id":"","url":"https://api.github.com/users/mdbartos","html_url":"https://github.com/mdbartos","followers_url":"https://api.github.com/users/mdbartos/followers","following_url":"https://api.github.com/users/mdbartos/following{/other_user}","gists_url":"https://api.github.com/users/mdbartos/gists{/gist_id}","starred_url":"https://api.github.com/users/mdbartos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdbartos/subscriptions","organizations_url":"https://api.github.com/users/mdbartos/orgs","repos_url":"https://api.github.com/users/mdbartos/repos","events_url":"https://api.github.com/users/mdbartos/events{/privacy}","received_events_url":"https://api.github.com/users/mdbartos/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mdbartos/influxdb-python","description":"Python client for InfluxDB","fork":true,"url":"https://api.github.com/repos/mdbartos/influxdb-python","forks_url":"https://api.github.com/repos/mdbartos/influxdb-python/forks","keys_url":"https://api.github.com/repos/mdbartos/influxdb-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mdbartos/influxdb-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mdbartos/influxdb-python/teams","hooks_url":"https://api.github.com/repos/mdbartos/influxdb-python/hooks","issue_events_url":"https://api.github.com/repos/mdbartos/influxdb-python/issues/events{/number}","events_url":"https://api.github.com/repos/mdbartos/influxdb-python/events","assignees_url":"https://api.github.com/repos/mdbartos/influxdb-python/assignees{/user}","branches_url":"https://api.github.com/repos/mdbartos/influxdb-python/branches{/branch}","tags_url":"https://api.github.com/repos/mdbartos/influxdb-python/tags","blobs_url":"https://api.github.com/repos/mdbartos/influxdb-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mdbartos/influxdb-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mdbartos/influxdb-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/mdbartos/influxdb-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mdbartos/influxdb-python/statuses/{sha}","languages_url":"https://api.github.com/repos/mdbartos/influxdb-python/languages","stargazers_url":"https://api.github.com/repos/mdbartos/influxdb-python/stargazers","contributors_url":"https://api.github.com/repos/mdbartos/influxdb-python/contributors","subscribers_url":"https://api.github.com/repos/mdbartos/influxdb-python/subscribers","subscription_url":"https://api.github.com/repos/mdbartos/influxdb-python/subscription","commits_url":"https://api.github.com/repos/mdbartos/influxdb-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/mdbartos/influxdb-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/mdbartos/influxdb-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/mdbartos/influxdb-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/mdbartos/influxdb-python/contents/{+path}","compare_url":"https://api.github.com/repos/mdbartos/influxdb-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mdbartos/influxdb-python/merges","archive_url":"https://api.github.com/repos/mdbartos/influxdb-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mdbartos/influxdb-python/downloads","issues_url":"https://api.github.com/repos/mdbartos/influxdb-python/issues{/number}","pulls_url":"https://api.github.com/repos/mdbartos/influxdb-python/pulls{/number}","milestones_url":"https://api.github.com/repos/mdbartos/influxdb-python/milestones{/number}","notifications_url":"https://api.github.com/repos/mdbartos/influxdb-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mdbartos/influxdb-python/labels{/name}","releases_url":"https://api.github.com/repos/mdbartos/influxdb-python/releases{/id}","deployments_url":"https://api.github.com/repos/mdbartos/influxdb-python/deployments","created_at":"2016-08-22T23:35:11Z","updated_at":"2016-08-22T23:35:12Z","pushed_at":"2016-08-29T20:02:00Z","git_url":"git://github.com/mdbartos/influxdb-python.git","ssh_url":"git@github.com:mdbartos/influxdb-python.git","clone_url":"https://github.com/mdbartos/influxdb-python.git","svn_url":"https://github.com/mdbartos/influxdb-python","homepage":null,"size":778,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"influxdata:master","ref":"master","sha":"7debaca04591ad34b6d0cf9545a82b40d9abc6b5","user":{"login":"influxdata","id":5713248,"avatar_url":"https://avatars.githubusercontent.com/u/5713248?v=3","gravatar_id":"","url":"https://api.github.com/users/influxdata","html_url":"https://github.com/influxdata","followers_url":"https://api.github.com/users/influxdata/followers","following_url":"https://api.github.com/users/influxdata/following{/other_user}","gists_url":"https://api.github.com/users/influxdata/gists{/gist_id}","starred_url":"https://api.github.com/users/influxdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influxdata/subscriptions","organizations_url":"https://api.github.com/users/influxdata/orgs","repos_url":"https://api.github.com/users/influxdata/repos","events_url":"https://api.github.com/users/influxdata/events{/privacy}","received_events_url":"https://api.github.com/users/influxdata/received_events","type":"Organization","site_admin":false},"repo":{"id":14151539,"name":"influxdb-python","full_name":"influxdata/influxdb-python","owner":{"login":"influxdata","id":5713248,"avatar_url":"https://avatars.githubusercontent.com/u/5713248?v=3","gravatar_id":"","url":"https://api.github.com/users/influxdata","html_url":"https://github.com/influxdata","followers_url":"https://api.github.com/users/influxdata/followers","following_url":"https://api.github.com/users/influxdata/following{/other_user}","gists_url":"https://api.github.com/users/influxdata/gists{/gist_id}","starred_url":"https://api.github.com/users/influxdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influxdata/subscriptions","organizations_url":"https://api.github.com/users/influxdata/orgs","repos_url":"https://api.github.com/users/influxdata/repos","events_url":"https://api.github.com/users/influxdata/events{/privacy}","received_events_url":"https://api.github.com/users/influxdata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/influxdata/influxdb-python","description":"Python client for InfluxDB","fork":false,"url":"https://api.github.com/repos/influxdata/influxdb-python","forks_url":"https://api.github.com/repos/influxdata/influxdb-python/forks","keys_url":"https://api.github.com/repos/influxdata/influxdb-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/influxdata/influxdb-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/influxdata/influxdb-python/teams","hooks_url":"https://api.github.com/repos/influxdata/influxdb-python/hooks","issue_events_url":"https://api.github.com/repos/influxdata/influxdb-python/issues/events{/number}","events_url":"https://api.github.com/repos/influxdata/influxdb-python/events","assignees_url":"https://api.github.com/repos/influxdata/influxdb-python/assignees{/user}","branches_url":"https://api.github.com/repos/influxdata/influxdb-python/branches{/branch}","tags_url":"https://api.github.com/repos/influxdata/influxdb-python/tags","blobs_url":"https://api.github.com/repos/influxdata/influxdb-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/influxdata/influxdb-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/influxdata/influxdb-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/influxdata/influxdb-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/influxdata/influxdb-python/statuses/{sha}","languages_url":"https://api.github.com/repos/influxdata/influxdb-python/languages","stargazers_url":"https://api.github.com/repos/influxdata/influxdb-python/stargazers","contributors_url":"https://api.github.com/repos/influxdata/influxdb-python/contributors","subscribers_url":"https://api.github.com/repos/influxdata/influxdb-python/subscribers","subscription_url":"https://api.github.com/repos/influxdata/influxdb-python/subscription","commits_url":"https://api.github.com/repos/influxdata/influxdb-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/influxdata/influxdb-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/influxdata/influxdb-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/influxdata/influxdb-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/influxdata/influxdb-python/contents/{+path}","compare_url":"https://api.github.com/repos/influxdata/influxdb-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/influxdata/influxdb-python/merges","archive_url":"https://api.github.com/repos/influxdata/influxdb-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/influxdata/influxdb-python/downloads","issues_url":"https://api.github.com/repos/influxdata/influxdb-python/issues{/number}","pulls_url":"https://api.github.com/repos/influxdata/influxdb-python/pulls{/number}","milestones_url":"https://api.github.com/repos/influxdata/influxdb-python/milestones{/number}","notifications_url":"https://api.github.com/repos/influxdata/influxdb-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/influxdata/influxdb-python/labels{/name}","releases_url":"https://api.github.com/repos/influxdata/influxdb-python/releases{/id}","deployments_url":"https://api.github.com/repos/influxdata/influxdb-python/deployments","created_at":"2013-11-05T19:27:16Z","updated_at":"2016-08-23T21:21:10Z","pushed_at":"2016-08-15T10:42:04Z","git_url":"git://github.com/influxdata/influxdb-python.git","ssh_url":"git@github.com:influxdata/influxdb-python.git","clone_url":"https://github.com/influxdata/influxdb-python.git","svn_url":"https://github.com/influxdata/influxdb-python","homepage":null,"size":1265,"stargazers_count":367,"watchers_count":367,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":183,"mirror_url":null,"open_issues_count":40,"forks":183,"open_issues":40,"watchers":367,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/influxdata/influxdb-python/pulls/364"},"html":{"href":"https://github.com/influxdata/influxdb-python/pull/364"},"issue":{"href":"https://api.github.com/repos/influxdata/influxdb-python/issues/364"},"comments":{"href":"https://api.github.com/repos/influxdata/influxdb-python/issues/364/comments"},"review_comments":{"href":"https://api.github.com/repos/influxdata/influxdb-python/pulls/364/comments"},"review_comment":{"href":"https://api.github.com/repos/influxdata/influxdb-python/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/influxdata/influxdb-python/pulls/364/commits"},"statuses":{"href":"https://api.github.com/repos/influxdata/influxdb-python/statuses/1af9d4e8eb6b9294e85c91196c107be3d5045f71"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":3,"additions":434,"deletions":57,"changed_files":5}}
{"actor":{"display_login":"mdbartos"}}