Skip to content

Conversation

@snehankekre
Copy link
Contributor

Migrated database tutorials from Notion pages to docs.

Description:

  • Updated TOC in index.md with section for database tutorials

  • Added the following tutorials to docs/tutorial/:

    • Connect Streamlit to Google BigQuery
    • Connect Streamlit to a public Google Sheet
    • Connect Streamlit to a private Google Sheet
    • Connect Streamlit to AWS S3
    • Connect Streamlit to PostgreSQL
    • Connect Streamlit to MongoDB
    • Connect Streamlit to Tableau
    • Connect Streamlit to Firestore (blog)
  • Note: Connect Streamlit to Firestore (blog) does not include an .md file. I've linked to the blog post in docs/tutorial/databases.md

  • Added images used in the tutorials to docs/media/databases/

  • Updated docs/requirements.txt with the sphinxcontrib-images Sphinx extension to allow for images in the tutorials to be expanded / enlarged when clicked. When required, we have placed images beside each other to reduce page length and allowed said images to be enlarged when clicked

  • Updated conf.py with the sphinxcontrib.images extension

Copy link
Contributor

@randyzwitch randyzwitch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marking this as approved, though please fix the typos. Otherwise, I know that the plan is to have a revision pass to clean things up further, and my comments can be viewed as statements towards that goal. They do NOT need to be implemented in order to merge this PR.


## Create a PostgreSQL database

If you already have a database that you want to use, feel free to [skip this step](#add-username-and-password-to-your-local-app-secrets).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

skip TO this step, make a NOTE

```

```eval_rst
.. note:: See ``st.cache`` above? Without it, Streamlit would run the query every time the app reruns (e.g. on a widget interaction). With ``st.cache``, it only runs when the query changes or after 10 minutes (that's what ``ttl`` is for). Watch out: If your database updates more frequently, you should adapt ``ttl`` or remove caching, so viewers always see the latest data. Read more about caching `here <../caching.html>`__.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move to paragraph

```eval_rst
.. note:: See ``st.cache`` above? Without it, Streamlit would run the query every time the app reruns (e.g. on a widget interaction). With ``st.cache``, it only runs when the query changes or after 10 minutes (that's what ``ttl`` is for). Watch out: If your database updates more frequently, you should adapt ``ttl`` or remove caching, so viewers always see the latest data. Read more about caching `here <../caching.html>`__.

.. tip:: Alternatively, you can use ``pandas.read_sql`` to read directly from your database into a dataframe. More info in this `tutorial <https://pythontic.com/pandas/serialization/postgresql>`_.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove for now, as it adds more information than necessary to show the example

@randyzwitch
Copy link
Contributor

Thanks for making those changes @snehankekre, I feel like the flow is much better now.

@randyzwitch randyzwitch merged commit e32df14 into streamlit:develop May 20, 2021
tconkling added a commit to tconkling/streamlit that referenced this pull request May 24, 2021
* develop:
  Init test variables in beforeEach
  Init test variables in beforeEach
  Add database tutorials to docs (streamlit#3272)
  update contact email to support (streamlit#3282)
  Better typing
  Remove dummy script
  Add testing and some comments
  Fix the bug, don't love the solution
  Improve test name
  Add script for testing
  Fix test after merge
  Make sure selected options aren't visible in the dropdown
  Add test for the fuzzy filter
  Import filter function from another component
tconkling added a commit to tconkling/streamlit that referenced this pull request May 25, 2021
# By Ken McGrady (19) and others
# Via GitHub (9) and others
* develop: (96 commits)
  st.form: clear_on_submit (streamlit#3287)
  Init test variables in beforeEach
  Init test variables in beforeEach
  Add database tutorials to docs (streamlit#3272)
  update contact email to support (streamlit#3282)
  Better typing
  Remove dummy script
  Add testing and some comments
  Fix the bug, don't love the solution
  Improve test name
  Add script for testing
  Fix test after merge
  Make sure selected options aren't visible in the dropdown
  Widget test cleanup (streamlit#3286)
  Add test for the fuzzy filter
  Import filter function from another component
  Remove tag from PR template (streamlit#3284)
  Add test req version bound for TF to fix tests (streamlit#3266)
  pin click to < 8.0 (streamlit#3256)
  Up version to 0.82.0
  ...

# Conflicts:
#	frontend/src/components/shared/Dropdown/Selectbox.test.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants