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

databricks: fix register to display SSO login link prior to timer expiration, fixes: #539 #527

Draft
wants to merge 23 commits into
base: master
Choose a base branch
from
Draft
Changes from 4 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
32941dd
fix: test change for the register command to use markdown instead of …
DataBoyTX Dec 20, 2023
1ac2521
fix syntax error
DataBoyTX Dec 20, 2023
d400975
add import for Markdown
DataBoyTX Dec 20, 2023
360a9eb
added class to print Markdown
DataBoyTX Dec 20, 2023
1b05c8f
fix: #539 - databricks login link and timer switch to javascript to h…
DataBoyTX Jan 17, 2024
1d4bc29
removed unused code from previous commit
DataBoyTX Jan 17, 2024
fdd74fc
added js timer for databricks
DataBoyTX Mar 5, 2024
1ce9643
fix syntax error in if stmt
DataBoyTX Mar 11, 2024
ded2bdc
added new func databricks_notebook_sso_login to present HTML link
DataBoyTX Mar 11, 2024
0ac0ab0
fix: skip _handle_auth_url in databricks_notebook_sso_login
DataBoyTX Mar 11, 2024
daa9e7f
fix: added global to point to databricks_notebook_sso_login
DataBoyTX Mar 11, 2024
ae9d912
fix: missing import in __init.py__ for databricks_notebook_sso_login
DataBoyTX Mar 11, 2024
1ab200c
fix: remove _get_auth_url call
DataBoyTX Mar 12, 2024
d2ef7bf
updated CHANGELOG and minor formatting changes in pygraphistry.py
DataBoyTX Mar 12, 2024
7ed40bd
remove blank lines from end of file for linter
DataBoyTX Mar 12, 2024
cbf96a0
add newline at end of file for linter
DataBoyTX Mar 12, 2024
aec9cb9
Merge branch 'master' of https://github.com/graphistry/pygraphistry i…
DataBoyTX Mar 12, 2024
05b7b63
merge with master
DataBoyTX Mar 12, 2024
d779e9d
indent typo
DataBoyTX Mar 12, 2024
e2ee637
remove missed merge section break
DataBoyTX Mar 13, 2024
6474810
added relogin back to databricks_notebook_sso_login func
DataBoyTX Mar 13, 2024
9a9c223
fix (databricks): display SSO login url for databrick notebook
vaimdev Mar 13, 2024
02b7825
Merge branch 'dbricks-sso-register' of github-dev:graphistry/pygraphi…
vaimdev Mar 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion graphistry/pygraphistry.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from typing_extensions import Literal
from graphistry.Plottable import Plottable
from graphistry.privacy import Mode, Privacy
from IPython.display import DisplayObject, TextDisplayObject
DataBoyTX marked this conversation as resolved.
Show resolved Hide resolved

"""Top-level import of class PyGraphistry as "Graphistry". Used to connect to the Graphistry server and then create a base plotter."""
import calendar, gzip, io, json, os, numpy as np, pandas as pd, requests, sys, time, warnings
Expand Down Expand Up @@ -99,6 +100,19 @@ def strtobool(val: Any) -> bool:
else:
raise ValueError("invalid truth value %r" % (val,))

# used to print Login link databricks register() call
class Markdown(TextDisplayObject):

def __init__(self,TextDisplayObject):
import markdown as md
DataBoyTX marked this conversation as resolved.
Show resolved Hide resolved

#converting markdown to html
self.html = md.markdown(TextDisplayObject)

def _repr_html_(self):
return self.html


class PyGraphistry(object):
_config = _get_initial_config()
_tag = util.fingerprint()
Expand Down Expand Up @@ -270,7 +284,8 @@ def _handle_auth_url(auth_url, sso_timeout, sso_opt_into_type):
if in_ipython() or in_databricks() or sso_opt_into_type == 'display': # If run in notebook, just display the HTML
# from IPython.core.display import HTML
from IPython.display import display, HTML
display(HTML(f'<a href="{auth_url}" target="_blank">Login SSO</a>'))
display(HTML(f'<a href="{auth_url}" target="_blank">old: Login SSO</a>'))
display(Markdown(f'[new: Login SSO]({auth_url})'))
DataBoyTX marked this conversation as resolved.
Show resolved Hide resolved
print("Please click the above URL to open browser to login")
print(f"If you cannot see the URL, please open browser, browse to this URL: {auth_url}")
print("Please close browser tab after SSO login to back to notebook")
Expand Down
Loading