{"action":"closed","issue":{"url":"https://api.github.com/repos/nevillelyh/shapeless-datatype/issues/16","repository_url":"https://api.github.com/repos/nevillelyh/shapeless-datatype","labels_url":"https://api.github.com/repos/nevillelyh/shapeless-datatype/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/nevillelyh/shapeless-datatype/issues/16/comments","events_url":"https://api.github.com/repos/nevillelyh/shapeless-datatype/issues/16/events","html_url":"https://github.com/nevillelyh/shapeless-datatype/issues/16","id":308594146,"number":16,"title":"BigQueryType.toTableRow does not serialize properly in lambda when there are custom types","user":{"login":"hansencc","id":2364578,"avatar_url":"https://avatars3.githubusercontent.com/u/2364578?v=4","gravatar_id":"","url":"https://api.github.com/users/hansencc","html_url":"https://github.com/hansencc","followers_url":"https://api.github.com/users/hansencc/followers","following_url":"https://api.github.com/users/hansencc/following{/other_user}","gists_url":"https://api.github.com/users/hansencc/gists{/gist_id}","starred_url":"https://api.github.com/users/hansencc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hansencc/subscriptions","organizations_url":"https://api.github.com/users/hansencc/orgs","repos_url":"https://api.github.com/users/hansencc/repos","events_url":"https://api.github.com/users/hansencc/events{/privacy}","received_events_url":"https://api.github.com/users/hansencc/received_events","type":"User","site_admin":false},"labels":[{"id":457039182,"url":"https://api.github.com/repos/nevillelyh/shapeless-datatype/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-03-26T14:23:08Z","updated_at":"2018-05-25T15:07:13Z","closed_at":"2018-05-25T15:07:12Z","author_association":"CONTRIBUTOR","body":"This serializes, but `BigQuerySchema` does not know about the custom types. Note: `releases` is a `SCollection[Release]`.\r\n```\r\n      val bqType: BigQueryType[Release] = BigQueryType[Release]\r\n      releases\r\n        .map { a =>\r\n          implicit val enumType\r\n            : BaseBigQueryMappableType[MyEnum] =\r\n            BigQueryType.at[MyEnum](\"STRING\")(\r\n              a => MyEnum.fromName(a.toString).orNull,\r\n              _.name)\r\n          bqType.toTableRow(a)\r\n        }\r\n        .saveAsBigQuery(\r\n          table,\r\n          schema = BigQuerySchema[Release]\r\n        )\r\n```\r\n\r\nThis does not serialize:\r\n```\r\n      implicit val enumType\r\n        : BaseBigQueryMappableType[MyEnum] =\r\n        BigQueryType.at[MyEnum](\"STRING\")(\r\n          a => MyEnum.fromName(a.toString).orNull,\r\n          _.name)\r\n      val bqType: BigQueryType[Release] = BigQueryType[Release]\r\n      val schema = BigQuerySchema[Release]\r\n\r\n      releases\r\n        .map { a =>\r\n          bqType.toTableRow(a)\r\n        }\r\n        .saveAsBigQuery(\r\n          table,\r\n          schema = schema\r\n        )\r\n```\r\n\r\n```\r\nException in thread \"main\" java.lang.IllegalArgumentException: unable to serialize anonymous function map ...\r\nCaused by: java.io.NotSerializableException ...\r\n```\r\n"}}
{"actor":{"display_login":"nevillelyh"}}