You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update CLAUDE.md to reflect current codebase state
- Add missing cursor types: PolarsCursor and S3FSCursor
- Reframe AsyncCursor as a variant pattern rather than a separate cursor type
- Fix parameter formatting section: remove incorrect qmark style reference,
add Presto/Hive escaping details and UNLOAD wrapping
- Expand project structure tree with all modules (polars/, s3fs/, sqlalchemy
compiler/types/preparer, top-level files)
- Add all SQLAlchemy dialects (polars, s3fs) to the listing
- Update release process to reflect hatch-vcs version management
- Include polars and s3fs in the "consider impact" cursor list
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CLAUDE.md
+79-25Lines changed: 79 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,11 +16,14 @@ PyAthena is a Python DB API 2.0 (PEP 249) compliant client library for Amazon At
16
16
17
17
### 2. Multiple Cursor Types
18
18
The project supports different cursor implementations for various use cases:
19
-
-**Standard Cursor** (`pyathena.cursor.Cursor`): Basic DB API cursor
20
-
-**Async Cursor** (`pyathena.async_cursor.AsyncCursor`): For asynchronous operations
21
-
-**Pandas Cursor** (`pyathena.pandas.cursor.PandasCursor`): Returns results as DataFrames
19
+
-**Standard Cursor** (`pyathena.cursor.Cursor`): Basic DB API cursor returning tuples
20
+
-**Pandas Cursor** (`pyathena.pandas.cursor.PandasCursor`): Returns results as pandas DataFrames
22
21
-**Arrow Cursor** (`pyathena.arrow.cursor.ArrowCursor`): Returns results in Apache Arrow format
23
-
-**Spark Cursor** (`pyathena.spark.cursor.SparkCursor`): For PySpark integration
22
+
-**Polars Cursor** (`pyathena.polars.cursor.PolarsCursor`): Returns results as Polars DataFrames
23
+
-**S3FS Cursor** (`pyathena.s3fs.cursor.S3FSCursor`): Lightweight CSV-based cursor using S3 filesystem (no pandas/arrow dependency)
24
+
-**Spark Cursor** (`pyathena.spark.cursor.SparkCursor`): For PySpark integration with Athena Spark workgroups
25
+
26
+
Each cursor type (except Spark) has a corresponding async variant (e.g., `AsyncCursor`, `AsyncPandasCursor`, `AsyncArrowCursor`, `AsyncPolarsCursor`, `AsyncS3FSCursor`).
24
27
25
28
### 3. Type System and Conversion
26
29
- Data type conversion is handled in `pyathena/converter.py`
-Two parameter styles supported: `pyformat` (default) and `qmark`
237
-
- Parameter formatting logic in `formatter.py`
238
-
-PyFormat: `%(name)s` style
239
-
-Qmark: `?`style
284
+
-Parameter style: `pyformat` (`%(name)s` style) as declared in DB API 2.0 globals
285
+
- Parameter formatting logic in `formatter.py` (`DefaultParameterFormatter`)
286
+
-Uses Presto-style escaping (single quote doubling) for SELECT/WITH/INSERT/UPDATE/MERGE statements
287
+
-Uses Hive-style escaping (backslash-based) for DDL statements (CREATE, DROP, etc.)
240
288
- Always escape special characters in parameter values
289
+
-`Formatter.wrap_unload()` wraps SELECT/WITH queries with UNLOAD for high-performance Parquet/ORC result retrieval
241
290
242
291
#### Result Set Handling
243
292
- Results are typically staged in S3 (configured via `s3_staging_dir`)
@@ -289,11 +338,16 @@ When implementing filesystem methods:
289
338
4. Don't forget to close cursors and connections to clean up resources
290
339
5. Be aware of Athena service quotas and rate limits
291
340
292
-
### Release Process
293
-
1. Update version in `pyathena/__init__.py`
294
-
2. Ensure all tests pass
295
-
3. Create a git tag for the release
296
-
4. Build and publish to PyPI
341
+
### Build System and Release Process
342
+
343
+
**Build System**: Hatchling with hatch-vcs for version control system integration.
344
+
345
+
**Version Management**: Versions are automatically derived from git tags via `hatch-vcs`. The generated version file is `pyathena/_version.py` (auto-generated, do not edit manually).
346
+
347
+
**Release Process**:
348
+
1. Ensure all tests pass
349
+
2. Create a git tag for the release (version is derived from the tag)
0 commit comments