Skip to content

snapshots and snapshot_metadata directories get deleted when you delete all snapshots #72

@jfischer

Description

@jfischer

To reproduce:

  • created two snapshots
  • deleted both snapshots
  • tried creating another snapshot. Got the error:
Traceback (most recent call last):
  File "/Users/jfischer/anaconda3/envs/dws-test-environment/lib/python3.6/site-packages/ipykernel/comm/manager.py", line 111, in comm_msg
    comm.handle_msg(msg)
  File "/Users/jfischer/anaconda3/envs/dws-test-environment/lib/python3.6/site-packages/ipykernel/comm/comm.py", line 161, in handle_msg
    self._msg_callback(msg)
  File "/Users/jfischer/code/data-workspaces-core/dataworkspaces/kits/jupyter.py", line 363, in _recv
    message=self._snapshot_args.message)
  File "/Users/jfischer/code/data-workspaces-core/dataworkspaces/api.py", line 103, in take_snapshot
    return snapshot_command(workspace, tag=tag, message=message)
  File "/Users/jfischer/code/data-workspaces-core/dataworkspaces/commands/snapshot.py", line 68, in snapshot_command
    existing_tag_md = mixin.get_snapshot_by_tag(tag)  # type: Optional[SnapshotMetadata]
  File "/Users/jfischer/code/data-workspaces-core/dataworkspaces/backends/git.py", line 445, in get_snapshot_by_tag
    for fname in os.listdir(md_dir):
FileNotFoundError: [Errno 2] No such file or directory: '/Users/jfischer/code/demo-for-talk/demo/.dataworkspace/snapshot_metadata'

Fix is to either always ensure both directories are present before taking a snapshot or creating a placeholder file when the workspace is created.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions