From fac94df2079a74a671797b7ed7e9488f49299689 Mon Sep 17 00:00:00 2001 From: akhil chatla Date: Tue, 22 Apr 2025 17:37:15 -0400 Subject: [PATCH 1/4] Improved documentation for read_sql_query with clear explanation and example --- docs/source/api.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/source/api.rst b/docs/source/api.rst index 21f44ea61..a7f10bc88 100644 --- a/docs/source/api.rst +++ b/docs/source/api.rst @@ -151,6 +151,25 @@ 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 --------------- From ae4c80acf234360efa1b24652a8de19335939356 Mon Sep 17 00:00:00 2001 From: akhil chatla Date: Tue, 22 Apr 2025 17:56:18 -0400 Subject: [PATCH 2/4] Fixed formatting issue with code block indentation in api.rst --- docs/source/api.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/source/api.rst b/docs/source/api.rst index a7f10bc88..3185d2054 100644 --- a/docs/source/api.rst +++ b/docs/source/api.rst @@ -151,7 +151,7 @@ Amazon Athena list_prepared_statements delete_prepared_statement - read_sql_query(sql, con, **kwargs) +read_sql_query(sql, con, **kwargs) ---------------------------------- Executes a SQL query and returns the result as a Pandas DataFrame. @@ -169,7 +169,6 @@ Executes a SQL query and returns the result as a Pandas DataFrame. # Run SQL query and get results into Pandas DataFrame df = wr.read_sql_query("SELECT * FROM employees", con=engine) - Amazon Redshift --------------- From 601b677964ec9182e645ada0894ade395ebf40e7 Mon Sep 17 00:00:00 2001 From: akhil chatla Date: Tue, 22 Apr 2025 18:45:09 -0400 Subject: [PATCH 3/4] Fix unclosed bold text in api.rst --- docs/source/api.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/api.rst b/docs/source/api.rst index 3185d2054..8fd3a0200 100644 --- a/docs/source/api.rst +++ b/docs/source/api.rst @@ -151,7 +151,7 @@ Amazon Athena list_prepared_statements delete_prepared_statement -read_sql_query(sql, con, **kwargs) +read_sql_query(sql, con, **kwargs**) ---------------------------------- Executes a SQL query and returns the result as a Pandas DataFrame. From 549c614a2afb3a26eb130942c8263df5687b0397 Mon Sep 17 00:00:00 2001 From: akhil chatla Date: Tue, 22 Apr 2025 18:51:18 -0400 Subject: [PATCH 4/4] Fix unclosed bold text in api.rst --- docs/source/api.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/api.rst b/docs/source/api.rst index 8fd3a0200..1c75ce5bb 100644 --- a/docs/source/api.rst +++ b/docs/source/api.rst @@ -152,7 +152,7 @@ Amazon Athena delete_prepared_statement read_sql_query(sql, con, **kwargs**) ----------------------------------- +------------------------------------- Executes a SQL query and returns the result as a Pandas DataFrame.