Open gtfierro opened 2 weeks ago
Could you simply create an .ipynb_checkpoints/.gitkeep
file (or similar), then do an assert in the test_utils.py
?
I'm not sure that would fix the issue, but maybe I'm misunderstanding how .gitkeep
works. The problem is the notebooks will create the checkpoints folder regardless. One example workflow:
tutorial
folder (used by the notebook) and make an adjustment to one of the filestutorial
folder within Jupyter created a checkpoints folder that now BuildingMOTIF is discovering. As a result, it finds two templates and/or libraries with the same name and throws a uniqueness constraint violation errorBefore:
tutorial/
templates.yml
after:
tutorial/
.ipynb_checkpoints/
templates.yml
templates.yml
Doesn't .gitkeep
keep the folder around? The above issue happens regardless of what git is doing
Yes, .gitkeep
keeps the folder around. I was just suggesting it as an example file for testing only. Not a file to actually create and track with Git.
Where is the uniqueness error coming from, sql db?
🤦 that should have been obvious to me.... thanks! That's a good suggestion for tests
Yes, the uniqueness constraint comes from our schema. We want library names to be unique, and we want template names to be unique within each library.
This directory can contain duplicate files which have been cached when running a notebook. This can cause an issue when scanning the local file system for libraries and/or graphs, when BuildingMOTIF insists on enforcing uniqueness on certain tables. This patch prevents file in `.ipynb_chekcpoints' directories from being given to BuildingMOTIF.
@haneslinger @TShapinsky @MatthewSteen any ideas on how I could / should unit test this?