{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/1824","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/1824/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/1824/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/1824/events","html_url":"https://github.com/hashicorp/terraform/pull/1824","id":73655529,"number":1824,"title":"helper/schema: write \"attr.#\": \"0\" for empty maps","user":{"login":"phinze","id":37534,"avatar_url":"https://avatars.githubusercontent.com/u/37534?v=3","gravatar_id":"","url":"https://api.github.com/users/phinze","html_url":"https://github.com/phinze","followers_url":"https://api.github.com/users/phinze/followers","following_url":"https://api.github.com/users/phinze/following{/other_user}","gists_url":"https://api.github.com/users/phinze/gists{/gist_id}","starred_url":"https://api.github.com/users/phinze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phinze/subscriptions","organizations_url":"https://api.github.com/users/phinze/orgs","repos_url":"https://api.github.com/users/phinze/repos","events_url":"https://api.github.com/users/phinze/events{/privacy}","received_events_url":"https://api.github.com/users/phinze/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"mitchellh","id":1299,"avatar_url":"https://avatars.githubusercontent.com/u/1299?v=3","gravatar_id":"","url":"https://api.github.com/users/mitchellh","html_url":"https://github.com/mitchellh","followers_url":"https://api.github.com/users/mitchellh/followers","following_url":"https://api.github.com/users/mitchellh/following{/other_user}","gists_url":"https://api.github.com/users/mitchellh/gists{/gist_id}","starred_url":"https://api.github.com/users/mitchellh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitchellh/subscriptions","organizations_url":"https://api.github.com/users/mitchellh/orgs","repos_url":"https://api.github.com/users/mitchellh/repos","events_url":"https://api.github.com/users/mitchellh/events{/privacy}","received_events_url":"https://api.github.com/users/mitchellh/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-05-06T15:25:02Z","updated_at":"2015-05-06T15:26:06Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/hashicorp/terraform/pulls/1824","html_url":"https://github.com/hashicorp/terraform/pull/1824","diff_url":"https://github.com/hashicorp/terraform/pull/1824.diff","patch_url":"https://github.com/hashicorp/terraform/pull/1824.patch"},"body":"This fixes some perpetual diffs I saw in Atlas AccTests where an empty\r\nmap (`map[string]interface{}{}`) was being `d.Set` for \"metadata_full\".\r\n\r\nBecause the MapFieldWriter was not distinguishing between empty and nil,\r\nthis trigger the \"map delete\" logic and no count was written to the\r\nstate. This caused subsequent plans to improperly report a diff.\r\n\r\nHere we redefine the map delete functionality to explicitly trigger only\r\non `nil`, so we catch the `.#` field for empty maps."},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/99513677","html_url":"https://github.com/hashicorp/terraform/pull/1824#issuecomment-99513677","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/1824","id":99513677,"user":{"login":"phinze","id":37534,"avatar_url":"https://avatars.githubusercontent.com/u/37534?v=3","gravatar_id":"","url":"https://api.github.com/users/phinze","html_url":"https://github.com/phinze","followers_url":"https://api.github.com/users/phinze/followers","following_url":"https://api.github.com/users/phinze/following{/other_user}","gists_url":"https://api.github.com/users/phinze/gists{/gist_id}","starred_url":"https://api.github.com/users/phinze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phinze/subscriptions","organizations_url":"https://api.github.com/users/phinze/orgs","repos_url":"https://api.github.com/users/phinze/repos","events_url":"https://api.github.com/users/phinze/events{/privacy}","received_events_url":"https://api.github.com/users/phinze/received_events","type":"User","site_admin":false},"created_at":"2015-05-06T15:26:06Z","updated_at":"2015-05-06T15:26:06Z","body":"@mitchellh I know we've had a lot of churn in these types of situations, but I _believe_ this change is still correct and good. At least, it makes sense to me. :grinning: "}}