graphistry / pygraphistry

PyGraphistry is a Python library to quickly load, shape, embed, and explore big graphs with the GPU-accelerated Graphistry visual graph analyzer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Login with token throw error, there is no handling of refresh function for login with token

vaimdev opened this issue · comments

Describe the bug
Reported by Leo when trying to login with JWT token in Louie integration

graphistry.register(api=3, token=xyz)
...
g.plot()

is failing with an org_name KeyError bug
and trying to specify as

graphistry.register(api=3, token=xyz, org_name=user) does not help

(https://graphistry.slack.com/archives/D01SYERTH9A/p1684136101863949)
I'm now trying:

            print('redoing gauth')
            graphistry.api_token(tok)
            graphistry.org_name(user)
            graphistry.register(api=3, token=tok, org_name=user)
            graphistry.PyGraphistry.relogin = lambda: 1

as a workaround
To Reproduce
Code, including data, than can be run without editing:

import pandas as pd
import graphistry
#graphistry.register(api=3, username='...', password='...')

graphistry.edges(pd.from_csv('https://data.csv'), 's', 'd')).plot()

Expected behavior
No error
plot() successfully run

Actual behavior
What did happen

Screenshots
If applicable, any screenshots to help explain the issue

PyGraphistry API client environment
Latest version

Additional context
After debugging, found that when login with token, relogin function is not implemented at all.
The correct implementation should be getting the refresh_token when login and use refresh token to get a new access token.