Skip to content

Commit

Permalink
Removed bug related with parsing transformed cell
Browse files Browse the repository at this point in the history
  • Loading branch information
JaumeAmoresDS committed Sep 13, 2024
1 parent 3aa2f19 commit b9d9733
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nbmodular/cell2func.py
Original file line number Diff line number Diff line change
Expand Up @@ -2090,6 +2090,9 @@ def create_function(
kwarguments = {}
return_values = []

# original cell will be used for evaluating default values of function keyword parameters
# since transformed cell removes header from function when it is defined
original_cell = cell
cell = update_cell_code(cell, defined and not permanent)

if returns_bunch:
Expand Down Expand Up @@ -2138,7 +2141,7 @@ def create_function(
# and assign default values to those variables.
# This is only required if the function's code is run
# (i.e., when this_function.run is True)
self._evaluate_kwargs_defaults(cell)
self._evaluate_kwargs_defaults(original_cell)

return this_function

Expand Down

0 comments on commit b9d9733

Please sign in to comment.