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

pyArango.collection.Collection delete() not working in python Run mode but it works in debug mode using PyCharm #195

Open
al20139471 opened this issue Sep 22, 2020 · 0 comments

Comments

@al20139471
Copy link

I encountered a weird issue with pyArango.collection.Collection delete() function

First I need to check if the collection exists in the database. Then if it exists, delete it. And finally create the collection.
This following piece of code runs fine in Debug mode using PyCharm, meaning it deletes the collection from my localhost arangodb in MacOS. But when I run the code in terminal using python main.py it yields this error. The same error when I run main.py in PyCharm:
pyArango.theExceptions.CreationError: Database _system already has a collection named nodes_2020_09_21_FY20Q4. Errors: {}
Can you check and let me know what's the issue?
Here is main.py (the Connection arguments and node_nm are populated in actual file)

from pyArango.connection import Connection
conn = Connection(arangoURL=arango_host, username=user, password=password)
db = conn["_system"]
if db.hasCollection(node_nm):
     db[node_nm].delete()

node = db.createCollection(name=node_nm)
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

No branches or pull requests

1 participant