-
Notifications
You must be signed in to change notification settings - Fork 4
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
docs: Added Dash example. #76
Conversation
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified FilesNo covered modified files...
|
session_token = flask.request.headers.get('Posit-Connect-User-Session-Token') | ||
credentials_provider = viewer_credentials_provider(user_session_token=session_token) |
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.
I see a pattern like this in all of the examples, and I wonder if we can wrap this up more. Can we have a single function that detects, or try/excepts, to get the header from the places where shiny/flask/etc. put it? (Tangentially related: #54)
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.
I've had the same thought. I think that would be a nice addition. We'll need to follow the same pattern we did with pandas
to avoid having our SDK depend on each of the frameworks.
try:
import flask
except ImportError:
return None
It also varies quite a bit depending on the framework. For flask/fastapi, the headers are on the incoming request object. For shiny it's on the session
which is only available in the server block. We'll have to experiment with each of the frameworks more to see what feels like the right interface for this helper.
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.
For shiny it's on the session which is only available in the server block
Slighly complicated further by the fact that Shiny Express doesn't have a server block. But still, may be worth exploring.
examples/connect/dash/README.md
Outdated
To publish, make sure `CONNECT_SERVER`, `CONNECT_API_KEY`, `DATABRICKS_HOST`, `DATABRICKS_PATH` have valid values. Then, on a terminal session, enter the following command: | ||
|
||
```bash | ||
rsconnect deploy shiny . \ |
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.
rsconnect deploy shiny . \ | |
rsconnect deploy dash . \ |
Should this be dash
here?
examples/connect/dash/README.md
Outdated
The Databricks environment variables only need to be set once, unless a change needs to be made. If the values have not changed, you don’t need to provide them again when you publish updates to the document. | ||
|
||
``` | ||
rsconnect deploy shiny . \ |
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.
rsconnect deploy shiny . \ | |
rsconnect deploy dash . \ |
Same as above?
## Start the app locally | ||
|
||
```bash | ||
python app.py |
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.
I think we should talk about the required environment variables before we show how to run the app. This fails if the user hasn't set DATABRICKS_HOST
and DATABRICKS_PATH
in their shell
No description provided.