{"action":"created","issue":{"url":"https://api.github.com/repos/mtth/hdfs/issues/69","repository_url":"https://api.github.com/repos/mtth/hdfs","labels_url":"https://api.github.com/repos/mtth/hdfs/issues/69/labels{/name}","comments_url":"https://api.github.com/repos/mtth/hdfs/issues/69/comments","events_url":"https://api.github.com/repos/mtth/hdfs/issues/69/events","html_url":"https://github.com/mtth/hdfs/issues/69","id":204765385,"number":69,"title":"Dataframe extension: order of columns not preserved","user":{"login":"ha62791","id":8383603,"avatar_url":"https://avatars.githubusercontent.com/u/8383603?v=3","gravatar_id":"","url":"https://api.github.com/users/ha62791","html_url":"https://github.com/ha62791","followers_url":"https://api.github.com/users/ha62791/followers","following_url":"https://api.github.com/users/ha62791/following{/other_user}","gists_url":"https://api.github.com/users/ha62791/gists{/gist_id}","starred_url":"https://api.github.com/users/ha62791/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ha62791/subscriptions","organizations_url":"https://api.github.com/users/ha62791/orgs","repos_url":"https://api.github.com/users/ha62791/repos","events_url":"https://api.github.com/users/ha62791/events{/privacy}","received_events_url":"https://api.github.com/users/ha62791/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-02-02T02:22:20Z","updated_at":"2017-02-04T04:05:44Z","closed_at":"2017-02-04T04:05:44Z","body":"My dataframe has below data when printed:\r\n```\r\ndf\r\nOut[149]: \r\n       user gender        age  \\\r\n0     Peter      F  23.000000   \r\n1   M.A.R.Y      F  27.333333   \r\n2  The King      M  28.000000   \r\n3   Tim Tom      M  28.000000   \r\n4      Mary      F  29.000000   \r\n\r\n                                          self_intro  \r\n0  Hello, my name is Peter. I am graduated from t...  \r\n1  I am Mary. I am from Maryland. I was born from...  \r\n2                                I am King. The end.  \r\n3  Hi, I am Tim Tom. I love eating snakes. I am v...  \r\n4                                                ...  \r\n```\r\nI use below code to test:\r\n```\r\nwrite_dataframe(hdfs_client, df_avro_filepath, df, overwrite=True)\r\n_df = read_dataframe(hdfs_client, df_avro_filepath)\r\nprint(_df)\r\npd.util.testing.assert_frame_equal(df, _df)\r\n```\r\nand the output has the column sorted alphabetically:\r\n```\r\n         age gender                                         self_intro  \\\r\n0  29.000000      F                                                ...   \r\n1  27.333334      F  I am Mary. I am from Maryland. I was born from...   \r\n2  23.000000      F  Hello, my name is Peter. I am graduated from t...   \r\n3  28.000000      M  Hi, I am Tim Tom. I love eating snakes. I am v...   \r\n4  28.000000      M                                I am King. The end.   \r\n\r\n       user  \r\n0      Mary  \r\n1   M.A.R.Y  \r\n2     Peter  \r\n3   Tim Tom  \r\n4  The King \r\n```\r\n```\r\n...\r\nAssertionError: DataFrame.columns are different\r\n\r\nDataFrame.columns values are different (75.0 %)\r\n[left]:  Index(['user', 'gender', 'age', 'self_intro'], dtype='object')\r\n[right]: Index(['age', 'gender', 'self_intro', 'user'], dtype='object')\r\n```"},"comment":{"url":"https://api.github.com/repos/mtth/hdfs/issues/comments/277417061","html_url":"https://github.com/mtth/hdfs/issues/69#issuecomment-277417061","issue_url":"https://api.github.com/repos/mtth/hdfs/issues/69","id":277417061,"user":{"login":"mtth","id":1216372,"avatar_url":"https://avatars.githubusercontent.com/u/1216372?v=3","gravatar_id":"","url":"https://api.github.com/users/mtth","html_url":"https://github.com/mtth","followers_url":"https://api.github.com/users/mtth/followers","following_url":"https://api.github.com/users/mtth/following{/other_user}","gists_url":"https://api.github.com/users/mtth/gists{/gist_id}","starred_url":"https://api.github.com/users/mtth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtth/subscriptions","organizations_url":"https://api.github.com/users/mtth/orgs","repos_url":"https://api.github.com/users/mtth/repos","events_url":"https://api.github.com/users/mtth/events{/privacy}","received_events_url":"https://api.github.com/users/mtth/received_events","type":"User","site_admin":false},"created_at":"2017-02-04T04:05:44Z","updated_at":"2017-02-04T04:05:44Z","body":"Just released a new version, `2.0.16`, that should address this issue: any dataframes you upload then download should retain their original column order."}}
{"actor":{"display_login":"mtth"}}