Skip to content

Commit 5f75492

Browse files
Merge pull request #636 from laughingman7743/feature/polars-cursor
Add PolarsCursor for native Polars DataFrame support
2 parents 81cf7d6 + ccd1c8c commit 5f75492

31 files changed

+3005
-45
lines changed

docs/api.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ This section provides comprehensive API documentation for all PyAthena classes a
1818
api/sqlalchemy
1919
api/pandas
2020
api/arrow
21+
api/polars
2122
api/s3fs
2223
api/spark
2324

@@ -44,5 +45,6 @@ Specialized integrations
4445
- :ref:`api_sqlalchemy` - SQLAlchemy dialect implementations
4546
- :ref:`api_pandas` - pandas DataFrame integration
4647
- :ref:`api_arrow` - Apache Arrow columnar data integration
48+
- :ref:`api_polars` - Polars DataFrame integration (no pyarrow required)
4749
- :ref:`api_s3fs` - Lightweight S3FS-based cursor (no pandas/pyarrow required)
4850
- :ref:`api_spark` - Apache Spark integration for big data processing

docs/api/polars.rst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
.. _api_polars:
2+
3+
Polars Integration
4+
==================
5+
6+
This section covers Polars-specific cursors, result sets, and data converters.
7+
8+
Polars Cursors
9+
--------------
10+
11+
.. autoclass:: pyathena.polars.cursor.PolarsCursor
12+
:members:
13+
:inherited-members:
14+
15+
.. autoclass:: pyathena.polars.async_cursor.AsyncPolarsCursor
16+
:members:
17+
:inherited-members:
18+
19+
Polars Result Set
20+
-----------------
21+
22+
.. autoclass:: pyathena.polars.result_set.AthenaPolarsResultSet
23+
:members:
24+
:inherited-members:
25+
26+
Polars Data Converters
27+
----------------------
28+
29+
.. autoclass:: pyathena.polars.converter.DefaultPolarsTypeConverter
30+
:members:
31+
32+
.. autoclass:: pyathena.polars.converter.DefaultPolarsUnloadTypeConverter
33+
:members:
34+
35+
Polars Utilities
36+
----------------
37+
38+
.. autofunction:: pyathena.polars.util.to_column_info
39+
40+
.. autofunction:: pyathena.polars.util.get_athena_type

docs/cursor.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,16 @@ AsyncArrowCursor
319319

320320
See :ref:`async-arrow-cursor`.
321321

322+
PolarsCursor
323+
------------
324+
325+
See :ref:`polars-cursor`.
326+
327+
AsyncPolarsCursor
328+
-----------------
329+
330+
See :ref:`async-polars-cursor`.
331+
322332
S3FSCursor
323333
----------
324334

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Documentation
2020
sqlalchemy
2121
pandas
2222
arrow
23+
polars
2324
s3fs
2425
spark
2526
testing

docs/introduction.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ Extra packages:
3232
+---------------+---------------------------------------+------------------+
3333
| Arrow | ``pip install PyAthena[Arrow]`` | >=7.0.0 |
3434
+---------------+---------------------------------------+------------------+
35+
| Polars | ``pip install PyAthena[Polars]`` | >=1.0.0 |
36+
+---------------+---------------------------------------+------------------+
3537

3638
.. _features:
3739

@@ -43,7 +45,7 @@ PyAthena provides comprehensive support for Amazon Athena's data types and featu
4345
**Core Features:**
4446
- **DB API 2.0 Compliance**: Full PEP 249 compatibility for database operations
4547
- **SQLAlchemy Integration**: Native dialect support with table reflection and ORM capabilities
46-
- **Multiple Cursor Types**: Standard, Pandas, Arrow, S3FS, and Spark cursor implementations
48+
- **Multiple Cursor Types**: Standard, Pandas, Arrow, Polars, S3FS and Spark cursor implementations
4749
- **Async Support**: Asynchronous query execution for non-blocking operations
4850

4951
**Data Type Support:**

0 commit comments

Comments
 (0)