)]}'
{"mistral/workbook/parser.py":[{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"cd3876d5f3c1d113d69a5bb6263b142fb65d3848","unresolved":false,"context_lines":[{"line_number":115,"context_line":""},{"line_number":116,"context_line":"def get_task_spec(spec_dict):"},{"line_number":117,"context_line":"    if _get_spec_version(spec_dict) \u003d\u003d V2_0:"},{"line_number":118,"context_line":"        return base.instantiate_spec(tasks_v2.TaskSpec, spec_dict)"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    return None"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_e08f26cb","line":118,"updated":"2015-09-11 09:50:55.000000000","message":"Yes, thanks for this change. I overlooked it when I was doing refactoring.","commit_id":"a22c34c1b6f349584288e922ea66766e16467011"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"103a7861c3b70a64f6407327e0d2c8efc3e5c63d","unresolved":false,"context_lines":[{"line_number":115,"context_line":""},{"line_number":116,"context_line":"def get_task_spec(spec_dict):"},{"line_number":117,"context_line":"    if _get_spec_version(spec_dict) \u003d\u003d V2_0:"},{"line_number":118,"context_line":"        return base.instantiate_spec(tasks_v2.TaskSpec, spec_dict)"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    return None"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba15a1d1_d6a471a7","line":118,"updated":"2015-09-15 10:53:32.000000000","message":"Ooh, here\u0027s the place that explains me why we need to inject \u0027type\u0027 for tasks. I we don\u0027t do this we won\u0027t be able to restore a task spec based on \u0027spec\u0027 field that we have in TaskExecution db model. And hence we really need this polymorphic behaviour for tasks too.\n\nMakes sense! Sorry that I missed this important part when I was reviewing the previous patchset.","commit_id":"7a12e30d072210ba5b8f9b3bdde2a601e56e7bee"}],"mistral/workbook/v2/tasks.py":[{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"cd3876d5f3c1d113d69a5bb6263b142fb65d3848","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"class TaskSpec(base.BaseSpec):"},{"line_number":35,"context_line":"    # See http://json-schema.org"},{"line_number":36,"context_line":"    _polymorphic_key \u003d (\u0027type\u0027, \u0027direct\u0027)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    _schema \u003d {"},{"line_number":39,"context_line":"        \"type\": \"object\","}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_e0f8864c","line":36,"updated":"2015-09-11 09:50:55.000000000","message":"See my comment in workflows.py","commit_id":"a22c34c1b6f349584288e922ea66766e16467011"}],"mistral/workbook/v2/workflows.py":[{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"cd3876d5f3c1d113d69a5bb6263b142fb65d3848","unresolved":false,"context_lines":[{"line_number":58,"context_line":"            task_defaults.TaskDefaultsSpec"},{"line_number":59,"context_line":"        )"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"        # Inject \u0027type\u0027 here, so instantiate_spec function can recognize the"},{"line_number":62,"context_line":"        # specific subclass of TaskSpec."},{"line_number":63,"context_line":"        for task in self._data.get(\u0027tasks\u0027).itervalues():"},{"line_number":64,"context_line":"            task[\u0027type\u0027] \u003d self._type"}],"source_content_type":"text/x-python","patch_set":1,"id":"da20952f_a0c7ee10","line":61,"updated":"2015-09-11 09:50:55.000000000","message":"Lingxian,\n\nI think we just don\u0027t really need to use this polymorphic mechanism for task. Instead, we can just override class __init__ method for DirectWorkflowSpec and ReverseWorkflowSpec and build self._tasks in there where know exactly which type of task we expect.","commit_id":"a22c34c1b6f349584288e922ea66766e16467011"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"a63e30181487ad639dc9014993aed3701544f224","unresolved":false,"context_lines":[{"line_number":58,"context_line":"            task_defaults.TaskDefaultsSpec"},{"line_number":59,"context_line":"        )"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"        # Inject \u0027type\u0027 here, so instantiate_spec function can recognize the"},{"line_number":62,"context_line":"        # specific subclass of TaskSpec."},{"line_number":63,"context_line":"        for task in self._data.get(\u0027tasks\u0027).itervalues():"},{"line_number":64,"context_line":"            task[\u0027type\u0027] \u003d self._type"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba15a1d1_244db072","line":61,"in_reply_to":"ba15a1d1_55741bfc","updated":"2015-09-14 08:40:44.000000000","message":"We do we need to inject task type? The only reason is this polymorphic mechanism. My reasoning is straight forward: now you have to modify several places (_polymorphic_key, _polymorhic_value, change schema etc.) to make it work whereas if you follow my approach you\u0027d just need to modify an initializer. In other words, the structure of specifications forks at workflow specifications level, and so when we deal with tasks it\u0027s already 100% clear what type of task we need to work with.","commit_id":"a22c34c1b6f349584288e922ea66766e16467011"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"895af93a5ad357a6f21a27b70977abecb44ce98d","unresolved":false,"context_lines":[{"line_number":58,"context_line":"            task_defaults.TaskDefaultsSpec"},{"line_number":59,"context_line":"        )"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"        # Inject \u0027type\u0027 here, so instantiate_spec function can recognize the"},{"line_number":62,"context_line":"        # specific subclass of TaskSpec."},{"line_number":63,"context_line":"        for task in self._data.get(\u0027tasks\u0027).itervalues():"},{"line_number":64,"context_line":"            task[\u0027type\u0027] \u003d self._type"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba15a1d1_55741bfc","line":61,"in_reply_to":"da20952f_a0c7ee10","updated":"2015-09-13 09:04:02.000000000","message":"Renat, although we know the exact type in specific WorkflowSpec class, but we still need inject task_type in each task_spec, it is not necessary to move this part of code to each WorkflowSpec class. What am I missing?","commit_id":"a22c34c1b6f349584288e922ea66766e16467011"}]}
