Changelogs >

Pyathena

PyUp actively tracks 429,349 Python packages for vulnerabilities to keep your Python environments secure.

Scan your dependencies

3.0.1

* Update JDBC driver to 2.0.16.

3.0.0

* Drop support for Python2.7 and Python3.5.
* Suport for Python3.8 and Python3.9.
* Add type hints.
* Update JDBC driver to 2.0.15.
The download URL for the JDBC driver has changed since 2.0.15.
2.0.14: https://s3.amazonaws.com/athena-downloads/drivers/JDBC/SimbaAthenaJDBC_2.0.14/AthenaJDBC42_2.0.14.jar
2.0.15: https://s3.amazonaws.com/athena-downloads/drivers/JDBC/SimbaAthenaJDBC-2.0.15.1000/AthenaJDBC42.jar
* Redesign Formatter and Converter classes.
Add JDBCTypeConverter abstract class and Formatter abstract class.
Change the name of JDBCTypeConverter to DefaultJDBCTypeConverter.
Change the name of ParameterFormatter to DefaultParameterFormatter.

2.9.5

* Update botocore and boto3 dependencies 337
Thanks zachliu 336

2.9.4

* Fix rendering of LIMIT / OFFSET clauses in SQLAlchemy to work with version 1.3 and lower 335
Thanks mdeshmu 334

2.9.3

* Support credentials with profile names in ArrowCursor and PandasCursor 332
* Add region name to boto3 session 333

2.9.2

* Add region_name to the argument passed to storage_options in Pandas 331

2.9.1

* Fix keyword arguments passed to storage_options in Pandas 328
Thanks shumingpeh 327

2.9.0

* Support for the UNLOAD option in PandasCursor/AsyncPandasCursor 325
https://github.com/laughingman7743/PyAthena#pandascursor-unload-options
Thanks annisall ztane DyfanJones 242

2.8.0

* Support for statement cache in SQLAlchemy 323

2.7.0

* Fix type hints, default values and order of cursor class constructor arguments 312
* Add cursor_kwargs to connection class arguments to allow passing cursor arguments 313
* Move DefaultPandasTypeConverter to pandas package 314
* Fix deprecation warning in re.compile 316
Thanks sadikkuzu 315
* Rename meta_data to metadata 317
* Fix type hints 318
* Fix type hints in return value of description
* Fix type hints in return value of asynchronous cursor's execute method
* Set default values for default conversion methods in converter
* Add missing type hints
* Add static method to cursor class to get default converter 319
* Implement ArrowCursor/AsyncArrowCursor 321
* https://github.com/laughingman7743/PyAthena#arrowcursor
* https://github.com/laughingman7743/PyAthena#asyncarrowcursor
* https://github.com/laughingman7743/PyAthena#dialect--driver
* ArrowCursor/AsyncArrowCursor supports the UNLOAD option.
https://github.com/laughingman7743/PyAthena#unload-options

2.6.1

* Add `cluster` and `bucket_count` to dialect options in SQLAlchemy 310
Support for bucketing in SQLAlchemy table creation.
* Support for specifying column options from connection strings 311
https://github.com/laughingman7743/PyAthena#column-options

2.6.0

* Add `row_format`, `file_format`, `serdeproperties` and `tblproperties` to dialect options in SQLAlchemy 306
* Support for creating tables in various file and row formats in SQLAlchemy.
https://github.com/laughingman7743/PyAthena#dialect-options
* Support for creating tables in various file and row formats is also available in the pandas.DataFrame.to_sql.
https://github.com/laughingman7743/PyAthena#to-sql
* The `s3_dir` option in the connection string has been removed and is now specified in the `location` of the dialect option.
* Remove `AthenaRowFormat` model class.
* Add `AthenaFileFormat` and `AthenaRowFormatSerde` model classes

2.5.4

* Fix escape handling for insert statements containing single quotes 304
Thanks bertop89 238
* Support for partition columns in SQLAlchemy 305

2.5.3

* Use new style classes 300
* Remove next method for compatibility with Python2 300
* Add missing type hints 301
* Support for compressed fields of table metadata in various data formats 302
* Add public method for metadata retrieval to cursor class 303

2.5.2

* Add missing partition key columns to get_columns in SQLAlchemy 293
Thanks nananathanh 292

2.5.1

* Fix CAST from STRING to VARCHAR for string types with unspecified length in SQLAlchemy 291
Thanks luca-ferreri andreaschiappacasse 289

2.5.0

* Add support for table and column comments in SQLAlchemy 264
Thanks cansjt 263
* Change partition repair in to_sql to ALTER TABLE ADD PARTITION instead of MSCK REPAIR TABLE 274 282
Thanks Liam3851 246, bajram-hushi 276
* Add AthenaPandas dialect 271
https://github.com/laughingman7743/PyAthena#dialect--driver
* Fix the syntax for combining the OFFSET and LIMIT clauses in SQLAlchemy 283
Thanks gruuya 280
* Remove table constraints from CREATE TABLE statements in SQLAlchemy 281
Thanks terrylimnsv 279
* Change to use INT as the column type for Integer type in SQLAlchemy DDL 281
Thanks terrylimnsv 279
* If length is not specified in VARCHAR, use the STRING type in SQLAlchemy 286
Thanks terrylimnsv 279
* Support VARCHAR type length in SQLAlchemy types 286
* Support DECIMAL type precision and scale in SQLAlchemy types 286
* Change metadata retrieval from information schema to API in SQLAlchemy 286
* Support for the If_not_exists option in SQLAlchemy 281
* Use to_dict instead of Iterrows in PandasCursor 284
Thanks avibrazil 254

2.4.1

- Fix to not include views when getting table names in SQLAlchemy.
- Support getting view names in SQLAlchemy
Thanks aaronsteers, cansjt. (244)

2.4.0

* Drop support for Python 3.6.
* Support for Python 3.10.
* Add base dialect definition `awsathena`, independent of driver notation.
* Add support for setting table location and compression in [dialect options](https://docs.sqlalchemy.org/en/14/core/foundation.html#sqlalchemy.sql.base.DialectKWArgs.dialect_options).
Thanks cansjt. (258)

2.3.2

* Support partitions with special chars table names.
Thanks fernbach. (255)

2.3.1

* Allow the boto3 session object to pass as an argument to the connection method.
Thanks benkehoe. (248)

2.3.0

* Support SQLAlchemy 1.4

2.2.0

* Change schema name (database name) to optional.
* Support for catalog.
Thanks milanaleksic. (220)

2.1.2

* Support duration_seconds, poll_interval and kill_on_interrupt options in SQLAlchemy connection string.
Thanks acountrec. (214)
* Support passing the execute method keyword arguments to the pandas.read_csv method arguments.
Thanks bjcttam, austinlostinboston. (169, 210)

2.1.1

* Update JDBC driver to 2.0.14

2.1.0

**This release contains compatibility-breaking changes.**
* Change the connect method and Connection object arguments to have the same name as the JDBC driver's Driver Configuration Options.

| Old argument names | New argument names |
| --- | --- |
| access_key | User |
| secret_key | Password |
| region_name | AwsRegion |
| schema_name | Schema |
| s3_staging_dir | S3OuputLocation |

* Changed the default authentication delegate to use DefaultAWSCredentialsProviderChain.
* Remove botocore dependencies.
* Update JDBC driver to 2.0.13.

2.0.9

Porting the following features from PyAthena.
* Impl AthenaTypeCompiler
https://github.com/laughingman7743/PyAthena/pull/147

2.0.8

Porting the following features from PyAthena.
* Change s3_staging_dir argument to optional.
https://github.com/laughingman7743/PyAthena/pull/107
* Support pandas.to_sql.
https://github.com/laughingman7743/PyAthena/pull/110
* Fix parameter format of Decimal type.
https://github.com/laughingman7743/PyAthena/pull/123
* Changed date and datetime type conversions to use literal values in all cases.
https://github.com/laughingman7743/PyAthena/pull/127
* Add code format configurations & Apply code formatting.
https://github.com/laughingman7743/PyAthena/pull/138

2.0.7

* Support China region endpoints.
Thanks liangruibupt. (laughingman7743/PyAthenaJDBC/issues/97)

2.0.6

* Update JDBC driver to 2.0.9
* Pinned the JPype version to 0.7.1 or less.
https://github.com/jpype-project/jpype/commit/f4f9321d691176067ac404a6412676ea8b9da7c9#diff-2eeaed663bd0d25b7e608891384b7298

2.0.5

* Support SQLAlchemy 1.3.0.
* Support JPype 0.7.0.
Thanks Thrameos. (laughingman7743/PyAthenaJDBC/pull/85)
* Exclude tests from dist package.
Thanks gaqzi. (laughingman7743/PyAthena/pull/86)

2.0.4

* Restrict the allowable version of SQLAlchemy(>=1.0.0, <1.3.0).
* Support Python 3.7
* Update JDBC driver to 2.0.7

2.0.3

* Update JDBC driver to 2.0.6

2.0.2

* Fix AttributeError: 'Engine' object has no attribute 'connection'.
Thanks mrshu. (laughingman7743/PyAthena/issues/63)
* Optimize get_columns method in SQLAlchemy.
Thanks mrshu. (laughingman7743/PyAthenaJDBC/issues/75)

2.0.1

* Fix to make it None when SQLAlchemy's URI username and password are empty strings.
If you do not specify `aws_access_key_id` and `aws_secret_access_key` in SQLAlchemy using the instance profile or boto3 configuration file, the connection string is as follows:

awsathena+jdbc://:athena.{region_name}.amazonaws.com:443/{schema_name}?s3_staging_dir={s3_staging_dir}&...

Thanks leahein. (laughingman7743/PyAthena/issues/54)
* Fix double escaping of percent character in SQLAlchemy.
Thanks mister-average. (laughingman7743/PyAthena/issues/56)

2.0.0

* Update JDBC driver to 2.0.5.
* Suppress log4j warnings.
* Fix the context manager to return a connection object instead of a cursor object.
* Remove query execution information.
Since the JDBC driver can not retrive query execution information, remove the following property from the cursor object. If you hack the JDBC driver, you may be able to retrive query execution information.
* QueryID
* OutputLocation
* DataScannedInBytes
* EngineExecutionTimeInMillis
* CompletionDateTime
* SubmissionDateTime

1.11.5

* Support duration_seconds, poll_interval and kill_on_interrupt options in SQLAlchemy connection string.
Thanks acountrec. (214)
* Support passing the execute method keyword arguments to the pandas.read_csv method arguments.
Thanks bjcttam, austinlostinboston. (169, 210)

1.11.4

* Change the default value of `na_values` in PandasCursor from `None` to `empty character`.
If you want to change the behavior to that of the previous version, explicitly set `na_values` to `None` in the argument of the execute method.

import pyathena
from pyathena.pandas_cursor import PandasCursor
cursor = pyathena.connect(s3_staging_dir="s3://YOUR_S3_BUCKET/path/to/",
region_name="us-west-2",
cursor_class=PandasCursor).cursor()
df = cursor.execute("SELECT * FROM many_rows",
na_values=None).as_pandas()

Thanks EdwardJRoss. (204)

1.11.3

* Support verify option in SQLAlchemy connection string.
Thanks tamersalama. (188)

1.3.4

* Fix type code contract.
PEP 249 - Type Objects and Constructors
https://www.python.org/dev/peps/pep-0249/#type-objects-and-constructors
Thanks memeplex. (laughingman7743/PyAthena/issues/32)

1.3.3

* Fix syntax error message hiding.
Thanks abridgett. (laughingman7743/PyAthenaJDBC54)

1.3.2

* Support session token with profile name.
Thanks djhworld. (laughingman7743/PyAthenaJDBC51)

1.3.1

* Add more types to SQLAlchemy type conversion.
* FLOAT
* REAL
* CHAR

1.3.0

* Support AWS credentials provider chain.
Thanks Tankanow. (laughingman7743/PyAthenaJDBC42)
* Drop support for PY26 & Add support for PY36.
* Add check of arraysize (fetch size).
The default arraysize (fetch size) is 1000.
The maximum allowable length is 1000.

1.2.0

* Change the behavior of the default formatter.
Escaping is required only for the query with parameter containing `%` character.
* Add query execution information.
Add properties of the following information on query execution to the cursor object.
* OutputLocation
* DataScannedInBytes
* EngineExecutionTimeInMillis
* CompletionDateTime
* SubmissionDateTime

1.1.2

* Update JDBC driver to 1.1.0
* Fix desc query error.

1.1.1

* Update JDBC driver to 1.0.1

1.1.0

* Support SQLAlchemy
* Change the format of query parameters to support SQLAlchemy in compliance with DB API 2.0 (PEP 249) .

1.0.9

1.0.8

1.0.7

1.0.6

1.0.5

1.0.4

1.0.3