Skip to content

Commit

Permalink
Delete lib log missing (pandas-dev#551)
Browse files Browse the repository at this point in the history
* Added log for non existing libraries when trying to delete

* Added logging functionality when deleting a library

* Added logging functionality when deleting a library
  • Loading branch information
eliquinox authored and bmoscon committed Apr 21, 2018
1 parent 0799940 commit dfc6ce9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions arctic/arctic.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import logging
import os
import re
import threading

import pymongo
from pymongo.errors import OperationFailure, AutoReconnect
import threading

from ._util import indent
from .auth import authenticate, get_auth
from .decorators import mongo_retry
Expand Down Expand Up @@ -233,6 +233,8 @@ def delete_library(self, library):
"""
l = ArcticLibraryBinding(self, library)
colname = l.get_top_level_collection().name
if not [c for c in l._db.collection_names(False) if re.match(r"^{}([\.].*)?$".format(colname), c)]:
logger.info('Nothing to delete. Arctic library %s does not exist.' % colname)
logger.info('Dropping collection: %s' % colname)
l._db.drop_collection(colname)
for coll in l._db.collection_names():
Expand Down

0 comments on commit dfc6ce9

Please sign in to comment.