Skip to content

Commit bc53e9f

Browse files
committed
10_checkpoint.ipynb: Fix Path.unlink(missing_ok=True) issue
The 'missing_ok' parameter was added to the Path.unlink() method in Python version 3.8. This is newer version than the one used by default by GitHub build action for nbdev. Instead, check if file exists before trying to unlink (remove) it.
1 parent 41272fe commit bc53e9f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

10_checkpoint.ipynb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,9 @@
800800
"_counter = 0\n",
801801
"\n",
802802
"df_filename = 'datasets/example_dataframe.csv.gz'\n",
803-
"Path(df_filename).unlink(missing_ok=True)\n",
803+
"# Path(df_filename).unlink(missing_ok=True)\n",
804+
"if not Path(df_filename).exists():\n",
805+
" Path(df_filename).unlink()\n",
804806
"\n",
805807
"# first time it should perform computations and save, second time get from file\n",
806808
"actual_df = compute_cached_df(example_dataframe, df_filename)\n",

0 commit comments

Comments
 (0)