Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rerun command snippet in "show error" modal #3117

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion luigi/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1560,7 +1560,9 @@ def re_enable_task(self, task_id):
def fetch_error(self, task_id, **kwargs):
if self._state.has_task(task_id):
task = self._state.get_task(task_id)
return {"taskId": task_id, "error": task.expl, 'displayName': task.pretty_id}
return {"taskId": task_id, "error": task.expl, 'displayName':
task.pretty_id, 'taskParams': task.params, 'taskModule':
task.module, 'taskFamily': task.family}
else:
return {"taskId": task_id, "error": ""}

Expand Down
2 changes: 2 additions & 0 deletions luigi/static/visualiser/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ <h4 class="modal-title" id="myModalLabel">Traceback for {{displayName}}</h4>
</div>
<div class="modal-body">
<pre class="pre-scrollable">{{error}}</pre>
Command to re-run:
<pre class="pre-scrollable">luigi --module {{taskModule}} {{taskFamily}} {{taskParams}}</pre>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
Expand Down
3 changes: 3 additions & 0 deletions luigi/static/visualiser/js/visualiserApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,9 @@ function visualiserApp(luigi) {

function showErrorTrace(data) {
data.error = decodeError(data.error);
if (data.taskParams) {
data.taskParams = Object.entries(data.taskParams).map(([k,v]) => `--${k.replace(/_/g, '-')} ${JSON.stringify(v)}`).join(" ");
}
$("#errorModal").empty().append(renderTemplate("errorTemplate", data));
$("#errorModal").modal({});
}
Expand Down