{"action":"created","comment":{"url":"https://api.github.com/repos/astropy/astropy/pulls/comments/38787996","id":38787996,"diff_hunk":"@@ -247,12 +263,23 @@ def write_table_hdf5(table, output, path=None, compression=False,\n     else:\n         dset = output_group.create_dataset(name, data=table.as_array())\n \n-    # Write the meta-data to the file\n-    for key in table.meta:\n-        val = table.meta[key]\n+    if serialize_meta:\n+        header_yaml = meta.get_yaml_from_table(table)\n+\n         try:\n-            dset.attrs[key] = val\n-        except TypeError:\n-            warnings.warn(\"Attribute `{0}` of type {1} cannot be written to \"\n-                          \"HDF5 files - skipping\".format(key, type(val)),\n-                          AstropyUserWarning)\n+            dset.attrs[META_KEY] = [h.encode('utf8') for h in header_yaml]\n+        except Exception as e:","path":"astropy/io/misc/hdf5.py","position":67,"original_position":67,"commit_id":"143862cf69c717190a5e56e2b089ab6ac28f75b7","original_commit_id":"143862cf69c717190a5e56e2b089ab6ac28f75b7","user":{"login":"taldcroft","id":348089,"avatar_url":"https://avatars.githubusercontent.com/u/348089?v=3","gravatar_id":"","url":"https://api.github.com/users/taldcroft","html_url":"https://github.com/taldcroft","followers_url":"https://api.github.com/users/taldcroft/followers","following_url":"https://api.github.com/users/taldcroft/following{/other_user}","gists_url":"https://api.github.com/users/taldcroft/gists{/gist_id}","starred_url":"https://api.github.com/users/taldcroft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taldcroft/subscriptions","organizations_url":"https://api.github.com/users/taldcroft/orgs","repos_url":"https://api.github.com/users/taldcroft/repos","events_url":"https://api.github.com/users/taldcroft/events{/privacy}","received_events_url":"https://api.github.com/users/taldcroft/received_events","type":"User","site_admin":false},"body":"I think this case should raise the exception instead of just a warning.  When you set `serialize_meta=True` that is an active statement from the user that the meta data should be encoded into the file.  If that can't be done for whatever reason it should fail.  In the default case, the user hasn't said anything about metadata and so it makes more sense to just have a warning.","created_at":"2015-09-04T19:50:17Z","updated_at":"2015-09-04T19:50:17Z","html_url":"https://github.com/astropy/astropy/pull/4103#discussion_r38787996","pull_request_url":"https://api.github.com/repos/astropy/astropy/pulls/4103","_links":{"self":{"href":"https://api.github.com/repos/astropy/astropy/pulls/comments/38787996"},"html":{"href":"https://github.com/astropy/astropy/pull/4103#discussion_r38787996"},"pull_request":{"href":"https://api.github.com/repos/astropy/astropy/pulls/4103"}}},"pull_request":{"url":"https://api.github.com/repos/astropy/astropy/pulls/4103","id":43646803,"html_url":"https://github.com/astropy/astropy/pull/4103","diff_url":"https://github.com/astropy/astropy/pull/4103.diff","patch_url":"https://github.com/astropy/astropy/pull/4103.patch","issue_url":"https://api.github.com/repos/astropy/astropy/issues/4103","number":4103,"state":"open","locked":false,"title":"Support saving table metadata in HDF5 as YAML","user":{"login":"matteobachetti","id":7190189,"avatar_url":"https://avatars.githubusercontent.com/u/7190189?v=3","gravatar_id":"","url":"https://api.github.com/users/matteobachetti","html_url":"https://github.com/matteobachetti","followers_url":"https://api.github.com/users/matteobachetti/followers","following_url":"https://api.github.com/users/matteobachetti/following{/other_user}","gists_url":"https://api.github.com/users/matteobachetti/gists{/gist_id}","starred_url":"https://api.github.com/users/matteobachetti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matteobachetti/subscriptions","organizations_url":"https://api.github.com/users/matteobachetti/orgs","repos_url":"https://api.github.com/users/matteobachetti/repos","events_url":"https://api.github.com/users/matteobachetti/events{/privacy}","received_events_url":"https://api.github.com/users/matteobachetti/received_events","type":"User","site_admin":false},"body":"This is the first draft of implementing YAML meta save in HDF5 I/O using #3723, using as a guide the solution in #3568. This is meant to address a couple of previous Issues (e.g. #3567, #3597). In its current state, #3597 still doesn't pass, but #3567 does.","created_at":"2015-08-28T16:34:12Z","updated_at":"2015-09-04T19:50:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"69d0a46b7d3ae3985bae9438052f136dc289ebc3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/astropy/astropy/pulls/4103/commits","review_comments_url":"https://api.github.com/repos/astropy/astropy/pulls/4103/comments","review_comment_url":"https://api.github.com/repos/astropy/astropy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/astropy/astropy/issues/4103/comments","statuses_url":"https://api.github.com/repos/astropy/astropy/statuses/143862cf69c717190a5e56e2b089ab6ac28f75b7","head":{"label":"matteobachetti:patch-1","ref":"patch-1","sha":"143862cf69c717190a5e56e2b089ab6ac28f75b7","user":{"login":"matteobachetti","id":7190189,"avatar_url":"https://avatars.githubusercontent.com/u/7190189?v=3","gravatar_id":"","url":"https://api.github.com/users/matteobachetti","html_url":"https://github.com/matteobachetti","followers_url":"https://api.github.com/users/matteobachetti/followers","following_url":"https://api.github.com/users/matteobachetti/following{/other_user}","gists_url":"https://api.github.com/users/matteobachetti/gists{/gist_id}","starred_url":"https://api.github.com/users/matteobachetti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matteobachetti/subscriptions","organizations_url":"https://api.github.com/users/matteobachetti/orgs","repos_url":"https://api.github.com/users/matteobachetti/repos","events_url":"https://api.github.com/users/matteobachetti/events{/privacy}","received_events_url":"https://api.github.com/users/matteobachetti/received_events","type":"User","site_admin":false},"repo":{"id":39197985,"name":"astropy","full_name":"matteobachetti/astropy","owner":{"login":"matteobachetti","id":7190189,"avatar_url":"https://avatars.githubusercontent.com/u/7190189?v=3","gravatar_id":"","url":"https://api.github.com/users/matteobachetti","html_url":"https://github.com/matteobachetti","followers_url":"https://api.github.com/users/matteobachetti/followers","following_url":"https://api.github.com/users/matteobachetti/following{/other_user}","gists_url":"https://api.github.com/users/matteobachetti/gists{/gist_id}","starred_url":"https://api.github.com/users/matteobachetti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matteobachetti/subscriptions","organizations_url":"https://api.github.com/users/matteobachetti/orgs","repos_url":"https://api.github.com/users/matteobachetti/repos","events_url":"https://api.github.com/users/matteobachetti/events{/privacy}","received_events_url":"https://api.github.com/users/matteobachetti/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/matteobachetti/astropy","description":"Repository for the Astropy core package","fork":true,"url":"https://api.github.com/repos/matteobachetti/astropy","forks_url":"https://api.github.com/repos/matteobachetti/astropy/forks","keys_url":"https://api.github.com/repos/matteobachetti/astropy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matteobachetti/astropy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matteobachetti/astropy/teams","hooks_url":"https://api.github.com/repos/matteobachetti/astropy/hooks","issue_events_url":"https://api.github.com/repos/matteobachetti/astropy/issues/events{/number}","events_url":"https://api.github.com/repos/matteobachetti/astropy/events","assignees_url":"https://api.github.com/repos/matteobachetti/astropy/assignees{/user}","branches_url":"https://api.github.com/repos/matteobachetti/astropy/branches{/branch}","tags_url":"https://api.github.com/repos/matteobachetti/astropy/tags","blobs_url":"https://api.github.com/repos/matteobachetti/astropy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matteobachetti/astropy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matteobachetti/astropy/git/refs{/sha}","trees_url":"https://api.github.com/repos/matteobachetti/astropy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matteobachetti/astropy/statuses/{sha}","languages_url":"https://api.github.com/repos/matteobachetti/astropy/languages","stargazers_url":"https://api.github.com/repos/matteobachetti/astropy/stargazers","contributors_url":"https://api.github.com/repos/matteobachetti/astropy/contributors","subscribers_url":"https://api.github.com/repos/matteobachetti/astropy/subscribers","subscription_url":"https://api.github.com/repos/matteobachetti/astropy/subscription","commits_url":"https://api.github.com/repos/matteobachetti/astropy/commits{/sha}","git_commits_url":"https://api.github.com/repos/matteobachetti/astropy/git/commits{/sha}","comments_url":"https://api.github.com/repos/matteobachetti/astropy/comments{/number}","issue_comment_url":"https://api.github.com/repos/matteobachetti/astropy/issues/comments{/number}","contents_url":"https://api.github.com/repos/matteobachetti/astropy/contents/{+path}","compare_url":"https://api.github.com/repos/matteobachetti/astropy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matteobachetti/astropy/merges","archive_url":"https://api.github.com/repos/matteobachetti/astropy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matteobachetti/astropy/downloads","issues_url":"https://api.github.com/repos/matteobachetti/astropy/issues{/number}","pulls_url":"https://api.github.com/repos/matteobachetti/astropy/pulls{/number}","milestones_url":"https://api.github.com/repos/matteobachetti/astropy/milestones{/number}","notifications_url":"https://api.github.com/repos/matteobachetti/astropy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matteobachetti/astropy/labels{/name}","releases_url":"https://api.github.com/repos/matteobachetti/astropy/releases{/id}","created_at":"2015-07-16T13:21:24Z","updated_at":"2015-07-16T13:21:29Z","pushed_at":"2015-09-03T19:29:58Z","git_url":"git://github.com/matteobachetti/astropy.git","ssh_url":"git@github.com:matteobachetti/astropy.git","clone_url":"https://github.com/matteobachetti/astropy.git","svn_url":"https://github.com/matteobachetti/astropy","homepage":"www.astropy.org","size":39242,"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":"astropy:master","ref":"master","sha":"c6480589ae627164beb32d211258bc277f037415","user":{"login":"astropy","id":847984,"avatar_url":"https://avatars.githubusercontent.com/u/847984?v=3","gravatar_id":"","url":"https://api.github.com/users/astropy","html_url":"https://github.com/astropy","followers_url":"https://api.github.com/users/astropy/followers","following_url":"https://api.github.com/users/astropy/following{/other_user}","gists_url":"https://api.github.com/users/astropy/gists{/gist_id}","starred_url":"https://api.github.com/users/astropy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astropy/subscriptions","organizations_url":"https://api.github.com/users/astropy/orgs","repos_url":"https://api.github.com/users/astropy/repos","events_url":"https://api.github.com/users/astropy/events{/privacy}","received_events_url":"https://api.github.com/users/astropy/received_events","type":"Organization","site_admin":false},"repo":{"id":2081289,"name":"astropy","full_name":"astropy/astropy","owner":{"login":"astropy","id":847984,"avatar_url":"https://avatars.githubusercontent.com/u/847984?v=3","gravatar_id":"","url":"https://api.github.com/users/astropy","html_url":"https://github.com/astropy","followers_url":"https://api.github.com/users/astropy/followers","following_url":"https://api.github.com/users/astropy/following{/other_user}","gists_url":"https://api.github.com/users/astropy/gists{/gist_id}","starred_url":"https://api.github.com/users/astropy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astropy/subscriptions","organizations_url":"https://api.github.com/users/astropy/orgs","repos_url":"https://api.github.com/users/astropy/repos","events_url":"https://api.github.com/users/astropy/events{/privacy}","received_events_url":"https://api.github.com/users/astropy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/astropy/astropy","description":"Repository for the Astropy core package","fork":false,"url":"https://api.github.com/repos/astropy/astropy","forks_url":"https://api.github.com/repos/astropy/astropy/forks","keys_url":"https://api.github.com/repos/astropy/astropy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/astropy/astropy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/astropy/astropy/teams","hooks_url":"https://api.github.com/repos/astropy/astropy/hooks","issue_events_url":"https://api.github.com/repos/astropy/astropy/issues/events{/number}","events_url":"https://api.github.com/repos/astropy/astropy/events","assignees_url":"https://api.github.com/repos/astropy/astropy/assignees{/user}","branches_url":"https://api.github.com/repos/astropy/astropy/branches{/branch}","tags_url":"https://api.github.com/repos/astropy/astropy/tags","blobs_url":"https://api.github.com/repos/astropy/astropy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/astropy/astropy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/astropy/astropy/git/refs{/sha}","trees_url":"https://api.github.com/repos/astropy/astropy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/astropy/astropy/statuses/{sha}","languages_url":"https://api.github.com/repos/astropy/astropy/languages","stargazers_url":"https://api.github.com/repos/astropy/astropy/stargazers","contributors_url":"https://api.github.com/repos/astropy/astropy/contributors","subscribers_url":"https://api.github.com/repos/astropy/astropy/subscribers","subscription_url":"https://api.github.com/repos/astropy/astropy/subscription","commits_url":"https://api.github.com/repos/astropy/astropy/commits{/sha}","git_commits_url":"https://api.github.com/repos/astropy/astropy/git/commits{/sha}","comments_url":"https://api.github.com/repos/astropy/astropy/comments{/number}","issue_comment_url":"https://api.github.com/repos/astropy/astropy/issues/comments{/number}","contents_url":"https://api.github.com/repos/astropy/astropy/contents/{+path}","compare_url":"https://api.github.com/repos/astropy/astropy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/astropy/astropy/merges","archive_url":"https://api.github.com/repos/astropy/astropy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/astropy/astropy/downloads","issues_url":"https://api.github.com/repos/astropy/astropy/issues{/number}","pulls_url":"https://api.github.com/repos/astropy/astropy/pulls{/number}","milestones_url":"https://api.github.com/repos/astropy/astropy/milestones{/number}","notifications_url":"https://api.github.com/repos/astropy/astropy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/astropy/astropy/labels{/name}","releases_url":"https://api.github.com/repos/astropy/astropy/releases{/id}","created_at":"2011-07-21T01:33:49Z","updated_at":"2015-09-03T00:47:34Z","pushed_at":"2015-09-04T19:40:37Z","git_url":"git://github.com/astropy/astropy.git","ssh_url":"git@github.com:astropy/astropy.git","clone_url":"https://github.com/astropy/astropy.git","svn_url":"https://github.com/astropy/astropy","homepage":"www.astropy.org","size":65868,"stargazers_count":639,"watchers_count":639,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":426,"mirror_url":null,"open_issues_count":618,"forks":426,"open_issues":618,"watchers":639,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/astropy/astropy/pulls/4103"},"html":{"href":"https://github.com/astropy/astropy/pull/4103"},"issue":{"href":"https://api.github.com/repos/astropy/astropy/issues/4103"},"comments":{"href":"https://api.github.com/repos/astropy/astropy/issues/4103/comments"},"review_comments":{"href":"https://api.github.com/repos/astropy/astropy/pulls/4103/comments"},"review_comment":{"href":"https://api.github.com/repos/astropy/astropy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/astropy/astropy/pulls/4103/commits"},"statuses":{"href":"https://api.github.com/repos/astropy/astropy/statuses/143862cf69c717190a5e56e2b089ab6ac28f75b7"}}}}