{"action":"created","issue":{"url":"https://api.github.com/repos/spotify/luigi/issues/1657","repository_url":"https://api.github.com/repos/spotify/luigi","labels_url":"https://api.github.com/repos/spotify/luigi/issues/1657/labels{/name}","comments_url":"https://api.github.com/repos/spotify/luigi/issues/1657/comments","events_url":"https://api.github.com/repos/spotify/luigi/issues/1657/events","html_url":"https://github.com/spotify/luigi/issues/1657","id":149023298,"number":1657,"title":"Task finished yet the luigi failed.","user":{"login":"junchenfeng","id":978427,"avatar_url":"https://avatars.githubusercontent.com/u/978427?v=3","gravatar_id":"","url":"https://api.github.com/users/junchenfeng","html_url":"https://github.com/junchenfeng","followers_url":"https://api.github.com/users/junchenfeng/followers","following_url":"https://api.github.com/users/junchenfeng/following{/other_user}","gists_url":"https://api.github.com/users/junchenfeng/gists{/gist_id}","starred_url":"https://api.github.com/users/junchenfeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/junchenfeng/subscriptions","organizations_url":"https://api.github.com/users/junchenfeng/orgs","repos_url":"https://api.github.com/users/junchenfeng/repos","events_url":"https://api.github.com/users/junchenfeng/events{/privacy}","received_events_url":"https://api.github.com/users/junchenfeng/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-04-18T02:29:53Z","updated_at":"2016-05-05T03:08:27Z","closed_at":null,"body":"I have py script contains the following task\r\n\r\nclass UpdateUserParameter(luigi.Task):\r\n    udt = luigi.DateParameter()\r\n    subject=luigi.Parameter()\r\n\r\n    def output(self):\r\n        return luigi.LocalTarget(local_proj_dir+'/data/crontab/{sub}/{dts}/is_user_parameter_updated.txt'.format(sub=self.subject, dts=self.udt.strftime('%Y-%m-%d')))\r\n    def requires(self):\r\n        return [users.UpdateUserParameterChain(subject=self.subject, udt=self.udt),\r\n                users.UpdateUserKnowledgePointMasteryBuffer(subject=self.subject, udt=self.udt)\r\n            ]\r\n\r\nWhen the task runs, all task output is produced (including the master task) but the master task returns the following error:\r\n\r\n\r\nTraceback (most recent call last):\r\n  File \"run_script.py\", line 91, in <module>\r\n    luigi.run()\r\n  File \"/usr/local/lib/python2.7/site-packages/luigi/interface.py\", line 210, in run\r\n    return _run(*args, **kwargs)['success']\r\n  File \"/usr/local/lib/python2.7/site-packages/luigi/interface.py\", line 238, in _run\r\n    return _schedule_and_run([cp.get_task_obj()], worker_scheduler_factory)\r\n  File \"/usr/local/lib/python2.7/site-packages/luigi/interface.py\", line 198, in _schedule_and_run\r\n    logger.info(execution_summary.summary(worker))\r\n  File \"/usr/local/lib/python2.7/site-packages/luigi/execution_summary.py\", line 384, in summary\r\n    return _summary_wrap(_summary_format(_summary_dict(worker), worker))\r\n  File \"/usr/local/lib/python2.7/site-packages/luigi/execution_summary.py\", line 333, in _summary_format\r\n    str_output += '{0}\\n'.format(_get_str(group_tasks[status], status in _PENDING_SUB_STATUSES))\r\n  File \"/usr/local/lib/python2.7/site-packages/luigi/execution_summary.py\", line 132, in _get_str\r\n    params = _get_set_of_params(tasks)\r\n  File \"/usr/local/lib/python2.7/site-packages/luigi/execution_summary.py\", line 173, in _get_set_of_params\r\n    params[param] = {getattr(task, param[0]) for task in tasks}\r\n  File \"/usr/local/lib/python2.7/site-packages/luigi/execution_summary.py\", line 173, in <setcomp>\r\n    params[param] = {getattr(task, param[0]) for task in tasks}\r\nTypeError: unhashable type: 'dict'\r\n\r\n\r\nBecause this error, other task depends on this cluster cannot be started. I cannot reliably reproduce this error and wonder how to fix it."},"comment":{"url":"https://api.github.com/repos/spotify/luigi/issues/comments/217066024","html_url":"https://github.com/spotify/luigi/issues/1657#issuecomment-217066024","issue_url":"https://api.github.com/repos/spotify/luigi/issues/1657","id":217066024,"user":{"login":"Tarrasch","id":294349,"avatar_url":"https://avatars.githubusercontent.com/u/294349?v=3","gravatar_id":"","url":"https://api.github.com/users/Tarrasch","html_url":"https://github.com/Tarrasch","followers_url":"https://api.github.com/users/Tarrasch/followers","following_url":"https://api.github.com/users/Tarrasch/following{/other_user}","gists_url":"https://api.github.com/users/Tarrasch/gists{/gist_id}","starred_url":"https://api.github.com/users/Tarrasch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tarrasch/subscriptions","organizations_url":"https://api.github.com/users/Tarrasch/orgs","repos_url":"https://api.github.com/users/Tarrasch/repos","events_url":"https://api.github.com/users/Tarrasch/events{/privacy}","received_events_url":"https://api.github.com/users/Tarrasch/received_events","type":"User","site_admin":false},"created_at":"2016-05-05T03:08:27Z","updated_at":"2016-05-05T03:08:27Z","body":"@tym-oao. Ok I see the problem and solution. We use a FrozenOrderedDict which thankfully *is* hashable. But the problem is when we have default values that are normal dict. Like `DictParameter(default=dict(blah=\"foo\"))`. One way to fix this:\r\n\r\n 1. Add test case in execution summary code\r\n 2. Run test and see it fails as expected\r\n 3. (the fix): Go to this code https://github.com/spotify/luigi/blob/31d9d81291ac697721594856613a653b5c2f6162/luigi/parameter.py#L747-L803, To `DictParameter` class add a `normalize` method. Ensuring that it's converts it's input to a value of type `FrozenOrderedDict`. Then the parameter-values will actually be hashable.\r\n 4. Run tests and hopefully it passes.\r\n\r\n@tym-oao. Do you want to send a PR? :)"}}