Skip to content

docs: Improved documentation for read_sql_query #3135

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

Closed
Closed
Changes from all commits
Commits
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
18 changes: 18 additions & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,24 @@ Amazon Athena
list_prepared_statements
delete_prepared_statement

read_sql_query(sql, con, **kwargs**)
-------------------------------------

Executes a SQL query and returns the result as a Pandas DataFrame.

**Example**:

.. code-block:: python

import awswrangler as wr
import sqlalchemy

# Create SQLAlchemy engine for MySQL
engine = sqlalchemy.create_engine("mysql+pymysql://user:password@host/dbname")

# Run SQL query and get results into Pandas DataFrame
df = wr.read_sql_query("SELECT * FROM employees", con=engine)

Amazon Redshift
---------------

Expand Down