-
Notifications
You must be signed in to change notification settings - Fork 209
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
Dev/sso login ux #608
base: master
Are you sure you want to change the base?
Dev/sso login ux #608
Conversation
Can you share the code sample in the PR? (Trouble accessing link, and discussion should be here) |
@vaimdev @DataBoyTX This looks strange from a dev UX layer, afaict: DemoIf I understand correctly, the below is the intended setup: cell 1: clear_output()
graphistry.databricks_sso_login_init() cell 2: clear_output()
graphistry.databricks_sso_login(server="test-2-40-74-dbt.grph.xyz", org_name="louiedev") cell 3: clear_output()
graphistry.databricks_sso_wait_for_token() cell 4: g.plot() DiscussionI understand wanting new underlying primitives, but how to expose it to users should be minimal, clean, integrated, smart defaults, etc
Examples of a two-cell: |
This PR should also include sample ipynb + docs updates. Sounds like we need to iterate first on interface definitions tho. The current is https://pygraphistry.readthedocs.io/en/latest/demos/demos_databases_apis/databricks_pyspark/graphistry-notebook-dashboard.html Maybe dashboards or auth should split out? |
graphistry/pygraphistry.py
Outdated
class DatabricksHelper(): | ||
|
||
@staticmethod | ||
def sso_repeat_get_token(repeat, wait): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public methods should have .rst-friendly docstrs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, we're trying to make all new code mypy-typed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, noted. I will add them in.
4 cells instead of 2, mainly because each cell will only display the output at the end of running of 1 cell. Previously, there are a few logic written into 1 cell and the output only be displayed after the cell is run which make the messages looks strange,
clear_output() is not necessary, can be removed.
Mainly for databricks dashboard but tested in both databricks notebook and databricks dashboard. |
graphistry/pygraphistry.py
Outdated
try: | ||
PyGraphistry.refresh() | ||
except Exception: | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this error case handling may need thinking?
graphistry/pygraphistry.py
Outdated
def databricks_sso_login_init(wait=20): | ||
from IPython.display import display, HTML, clear_output | ||
|
||
def init_login(wait): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
un-nest
suggestion from Leo: Show a message on Graphistry server, when SSO login from pygraphistry |
…ich originally just a refresh()
… will be displayed.
@vaimdev FYI ci lint issues |
Yes, noted, added some debugging code, now it is done and cleaning up code. |
Loom videos to demo the changes Databricks Notebook Log in - https://www.loom.com/share/2313bb86ef454a9f9d55c1535c785457?sid=42f46537-f726-4a89-a98d-96f762e0cf51 Dashboard |
graphistry/pygraphistry.py
Outdated
@staticmethod | ||
def sso_repeat_get_token(repeat: int = 20, wait: int = 5): | ||
""" Function to repeatly call to obtain the jwt token after sso login | ||
Function to obtain the JWT token after SSO login |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sabizmil can you check all public method docstr as these show up in the readthedocs?
Spelling, grammar, docstr types, and examples, following format of the rest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in the latest commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left comments with updated message content.
@vaimdev @sabizmil @DataBoyTX i'm updating |
@lmeyerov , my side I am still updating the code with documentation with lower priority because focus on the entitlement Saas. I'll suggest you landed your cleaned up version first |
@vaimdev can you update from @DataBoyTX any more to do to land? this has been drifting and seems worth putting in? |
An attempt to improve UI/UX to the databricks dashboard with SSO usage
Added a few helper functions, so that the databricks dashboard can keep a simpler flow and UX.
Example databricks notebooks that utilize the new helper functions
https://dbc-ac10efa1-77c5.cloud.databricks.com/editor/notebooks/3715908489050384?o=7408253037638600#command/1247495116400904
3 pre-steps for the SSO login using the helper functions (with different cells), followed by the actual plotting python code