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

[BUG] spanner queries give KeyError if spanner_config not set via register() #644

Open
DataBoyTX opened this issue Jan 25, 2025 · 0 comments
Assignees
Labels

Comments

@DataBoyTX
Copy link
Contributor

Describe the bug

if spanner_config not set, spanner_gql_to_g and likely spanner_query_to_df errors out. Need to handle better with error message on how to resolve vs python KeyError

To Reproduce

attempt to run a query without passing spanner_config to register:

g = graphistry.spanner_gql_to_g(query)

Expected behavior
Should give descriptive error and how to set with register vs KeyError

Actual behavior

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-6-b9aea2069736> in <cell line: 0>()
      2 MATCH p = (a)-[b]->(c) where 1=1 {LIMIT_CLAUSE} return SAFE_TO_JSON(p) as path'''
      3 
----> 4 g = graphistry.spanner_gql_to_g(query)

1 frames
/usr/local/lib/python3.11/dist-packages/graphistry/PlotterBase.py in spanner_gql_to_g(self, query)
   2531 
   2532         if not hasattr(res, '_spannergraph'):
-> 2533             spanner_config = PyGraphistry._config["spanner"]
   2534             if spanner_config is not None:
   2535                 logger.debug(f"Spanner Config: {spanner_config}")
@DataBoyTX DataBoyTX added the bug label Jan 25, 2025
@DataBoyTX DataBoyTX self-assigned this Jan 25, 2025
DataBoyTX added a commit that referenced this issue Jan 25, 2025
* fix: credential_file logic when not defined

* fix: spanner_cofig get logic and error when not defined

* chore: update to v0.35.10 in CHANGELOG.md w/ comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant