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

[ENH] Friendlier error when neo4j creds not provided #204

Closed
lmeyerov opened this issue Feb 7, 2021 · 1 comment
Closed

[ENH] Friendlier error when neo4j creds not provided #204

lmeyerov opened this issue Feb 7, 2021 · 1 comment

Comments

@lmeyerov
Copy link
Contributor

lmeyerov commented Feb 7, 2021

Community user usability report: If Neo4j creds or a driver are not provided, the error currently looks like:

/path/to/conda_env/lib/python3.8/site-packages/graphistry/plotter.py in cypher(self, query, params)
   1504         res = copy.copy(self)
   1505         driver = self._bolt_driver or PyGraphistry._config['bolt_driver']
-> 1506         with driver.session() as session:
   1507             bolt_statement = session.run(query, **params)
   1508             graph = bolt_statement.graph()
AttributeError: 'NoneType' object has no attribute 'session'

It'd be more friendly to do something like:

if driver is None:
    raise ValueError('No bolt  driver configured. Use register(bolt=...) to specify credentials or a driver.')
@lmeyerov
Copy link
Contributor Author

lmeyerov commented Feb 8, 2021

Lands in 0.16.2 -- #209

@lmeyerov lmeyerov closed this as completed Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant