pygraphistry icon indicating copy to clipboard operation
pygraphistry copied to clipboard

Dev/sso login ux

Open vaimdev opened this issue 1 year ago • 11 comments

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

graphistry.databricks_sso_login_init()
graphistry.databricks_sso_login(server="test-2-40-74-dbt.grph.xyz", org_name="louiedev")
graphistry.databricks_sso_wait_for_token()

vaimdev avatar Oct 28 '24 10:10 vaimdev

Can you share the code sample in the PR?

(Trouble accessing link, and discussion should be here)

lmeyerov avatar Oct 30 '24 16:10 lmeyerov

@vaimdev @DataBoyTX This looks strange from a dev UX layer, afaict:

Demo

If 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()

Discussion

I understand wanting new underlying primitives, but how to expose it to users should be minimal, clean, integrated, smart defaults, etc

  • Why is this 4 cells instead of 2?

  • why clear_output() ? Can we make that default-on parameter for the auth step with pass-in overrides?

  • I believe part of this weird path is SSO differences in how databricks headless, databricks notebooks, and databricks dashboards work; are these primitives for dashboards only, or notebook + headless too?

Examples of a two-cell: graphistry.register(sso='databricks').... g.plot():

lmeyerov avatar Oct 30 '24 16:10 lmeyerov

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?

lmeyerov avatar Oct 30 '24 16:10 lmeyerov

@vaimdev @DataBoyTX This looks strange from a dev UX layer, afaict:

Demo

If 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()

Discussion

I understand wanting new underlying primitives, but how to expose it to users should be minimal, clean, integrated, smart defaults, etc

  • Why is this 4 cells instead of 2?
  • why clear_output() ? Can we make that default-on parameter for the auth step with pass-in overrides?
  • I believe part of this weird path is SSO differences in how databricks headless, databricks notebooks, and databricks dashboards work; are these primitives for dashboards only, or notebook + headless too?

Examples of a two-cell: graphistry.register(sso='databricks').... g.plot():

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, in some cases, the refresh token will take place and the message shown is not correct. breaking it into 4 cells will make the the UX consistent and able to control the logic in the case of refresh token, to display the correct message

why clear_output() ? Can we make that default-on parameter for the auth step with pass-in overrides?

clear_output() is not necessary, can be removed.

I believe part of this weird path is SSO differences in how databricks headless, databricks notebooks, and databricks dashboards work; are these primitives for dashboards only, or notebook + headless too?

Mainly for databricks dashboard but tested in both databricks notebook and databricks dashboard.

vaimdev avatar Oct 31 '24 10:10 vaimdev

suggestion from Leo:

Show a message on Graphistry server, when SSO login from pygraphistry

vaimdev avatar Nov 02 '24 00:11 vaimdev

@vaimdev FYI ci lint issues

lmeyerov avatar Nov 08 '24 22:11 lmeyerov

@vaimdev FYI ci lint issues

Yes, noted, added some debugging code, now it is done and cleaning up code.

vaimdev avatar Nov 09 '24 01:11 vaimdev

Loom videos to demo the changes

Databricks Notebook Not login - https://www.loom.com/share/b48939faf5ba4578bc66218cb89cacb9?sid=c72bae54-9ce9-4128-8f2a-ebd128e70dad

Log in - https://www.loom.com/share/2313bb86ef454a9f9d55c1535c785457?sid=42f46537-f726-4a89-a98d-96f762e0cf51

Dashboard https://www.loom.com/share/68add6bd0c2348e0b0fc0b19abbf4939?sid=2a878545-e92c-4dca-843f-2f297d4fd52f

vaimdev avatar Nov 09 '24 15:11 vaimdev

@vaimdev @sabizmil @DataBoyTX i'm updating def plot() as well as part of some cleanup, and realized it'll conflict. Happy to land mine after this goes in -- any sense of timing here?

lmeyerov avatar Nov 26 '24 02:11 lmeyerov

@vaimdev @sabizmil @DataBoyTX i'm updating def plot() as well as part of some cleanup, and realized it'll conflict. Happy to land mine after this goes in -- any sense of timing here?

@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 avatar Nov 26 '24 04:11 vaimdev

@vaimdev can you update from master & retest , esp b/c changes from https://github.com/graphistry/pygraphistry/pull/615

@DataBoyTX any more to do to land? this has been drifting and seems worth putting in?

lmeyerov avatar Dec 24 '24 21:12 lmeyerov