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

setting clear_all=True in settings.ini is not respected #1041

Closed
mikedewar opened this issue Sep 12, 2022 · 2 comments · Fixed by #1049
Closed

setting clear_all=True in settings.ini is not respected #1041

mikedewar opened this issue Sep 12, 2022 · 2 comments · Fixed by #1049
Assignees

Comments

@mikedewar
Copy link

First of all, thanks so much for nbdev! I'm very excited to use it to improve our jupyter notebook practice with git. And apologies if the following isn't a bug and is just me misunderstanding something!

When I set

clear_all=True

in settings.ini I'm expecting all the output in my notebook to be removed upon saving the notebook. When I can get it working this is going to be incredibly useful as my team and I work in a very regulated space, and this will be a fantastic safety net to help us avoid committing data we're not supposed to via notebook output.

The hook in general is working, and my git diffs are doing great.

The problem is that the output's still there. So for example, after saving I still have this in the json of one of my cells:

{
   "cell_type": "code",
   "execution_count": null,
   "id": "2134439f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1 2 3\n"
     ]
    }
   ],
   "source": [
    "print(a,b,c)"
   ]
  },

instead of "outputs": [] as expected.

Having a dig in I wondered maybe if something was missing from the 16th cell of the clean notebook where _nbdev_clean is defined? That at least seems to be where the other configs seem to be gathered from.

Again, apologies if I'm missing something or messing something up. Any help would be appreciated!

@jph00
Copy link
Contributor

jph00 commented Sep 13, 2022

cc @seeM

seeM added a commit to seeM/nbdev that referenced this issue Sep 13, 2022
@seeM seeM mentioned this issue Sep 13, 2022
jph00 added a commit that referenced this issue Sep 14, 2022
@jph00
Copy link
Contributor

jph00 commented Sep 14, 2022

Should be fixed in master @mikedewar - we should be doing a release in the next few days if you'd rather avoid installing a prerelease.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants