Skip to content

Commit fdcc648

Browse files
authored
Merge pull request #139 from man-group/bugfix/hide-code-rerun
Ensure hide_code option is persisted and used in reruns. Closes #82
2 parents 40fbb97 + 1f8e16a commit fdcc648

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

notebooker/execute_notebook.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ def _run_checks(
136136
overrides=overrides,
137137
scheduler_job_id=scheduler_job_id,
138138
mailfrom=mailfrom,
139+
hide_code=hide_code,
139140
is_slideshow=is_slideshow,
140141
)
141142
return notebook_result
@@ -218,6 +219,7 @@ def run_report(
218219
generate_pdf_output=generate_pdf_output,
219220
scheduler_job_id=scheduler_job_id,
220221
mailfrom=mailfrom,
222+
hide_code=hide_code,
221223
is_slideshow=is_slideshow,
222224
)
223225
logger.error(

notebooker/web/routes/report_execution.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ def _rerun_report(job_id, prepare_only=False, run_synchronously=False):
234234
abort(404)
235235
prefix = "Rerun of "
236236
title = result.report_title if result.report_title.startswith(prefix) else (prefix + result.report_title)
237+
237238
with current_app.app_context():
238239
app_config = WebappConfig.from_superset_kwargs(current_app.config)
239240
new_job_id = run_report_in_subprocess(
@@ -242,6 +243,7 @@ def _rerun_report(job_id, prepare_only=False, run_synchronously=False):
242243
title,
243244
result.mailto,
244245
result.overrides,
246+
hide_code=result.hide_code,
245247
generate_pdf_output=result.generate_pdf_output,
246248
prepare_only=prepare_only,
247249
scheduler_job_id=None, # the scheduler will never call rerun

tests/integration/test_e2e.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ def test_run_report_and_rerun(
113113
generate_pdf_output=False,
114114
prepare_only=True,
115115
run_synchronously=True,
116+
hide_code=True,
117+
is_slideshow=True,
116118
)
117119
_check_report_output(
118120
job_id,
@@ -122,6 +124,8 @@ def test_run_report_and_rerun(
122124
report_title=report_title,
123125
mailto=mailto,
124126
generate_pdf_output=False,
127+
hide_code=True,
128+
is_slideshow=True,
125129
)
126130

127131
new_job_id = _rerun_report(job_id, prepare_only=True, run_synchronously=True)
@@ -133,6 +137,8 @@ def test_run_report_and_rerun(
133137
report_title="Rerun of " + report_title,
134138
mailto=mailto,
135139
generate_pdf_output=False,
140+
hide_code=True,
141+
is_slideshow=True,
136142
)
137143
assert new_job_id == serialiser.get_latest_job_id_for_name_and_params(report_name, overrides)
138144
assert not {job_id, new_job_id} - set(serialiser.get_all_job_ids_for_name_and_params(report_name, overrides))

0 commit comments

Comments
 (0)