Skip to content

Releases: ThibTrip/pangres

v4.2.1

05 Nov 20:50
Compare
Choose a tag to compare

Development

  • Fixed warning with Pyright related to "not exported" members of pangres for example when using import pangres and then pangres.upsert - Thanks to @DeflateAwning for reporting and fixing the issue #83

v4.2.0

03 Oct 20:39
df21a1d
Compare
Choose a tag to compare

WARNING: a new dependency was introduced packaging, as no better alternative was found to replace pkg_resources.parse_version after the release of Python 3.12 (see first point in section "Bug Fixes").

Bug Fixes

  • added support python 3.12. Thanks to @markm-io (see PR #75)
  • Removed this warning from sqlalchemy (see PR #81):
 MovedIn20Warning: The ``declarative_base()`` function is now available as sqlalchemy.orm.declarative_base(). (deprecated since: 2.0) (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)

Documentation

Development

  • migrated from circleci to GitHub actions (see PR #78)
  • added testing via CI for Python 3.9, 3.10, 3.11 and 3.12 (see PR #78 and #80)

v4.1.4

07 Apr 20:33
Compare
Choose a tag to compare

Bug Fixes

  • fixed compatibility with pandas==2.0.0. Thanks to @lordsutch

v4.1.3

06 Feb 01:03
70edbc2
Compare
Choose a tag to compare

Bug Fixes

  • pangres is now compatible with sqlalchemy>=2.0. IMPORTANT: you will need alembic>=1.7.2 (it is one of the dependencies of pangres) and Python >= 3.8
  • typing should now work (py.typed file was missing). Please note that support for typing is partial, unless you are using sqlalchemy>=2.0

Development

  • added code style check with flake8
  • improvements to linting and typing of internal as well as "public" objects

v4.1.2

29 Jul 20:04
Compare
Choose a tag to compare

Bug Fixes

  • pangres was not running on Python 3.10 because I never added packaging in requirements.txt. I fixed it by using pkg_resources from the standard library instead to avoid the additional dependency (see commit 89d3679)

    Note: the tests were running fine because we use pytest which uses packaging (so I never saw the missing dependency)

v4.1.1

13 Mar 17:15
Compare
Choose a tag to compare

Bug Fixes

  • fixed bug where I used a synchronous method instead of its asynchronous variant (UpsertQuery.execute instead of UpsertQuery.aexecute in pangres.aupsert). This has no repercussions for the end user

Documentation

  • fix illogic code in example for pangres.aupsert (using engine instead of connection in contexts) and commit which I had forgotten!
  • added changelog

Testing

  • overhaul of the tests. asynchronous and synchronous tests have been separated
  • module test_upsert_end_to_end has been renamed to test_core

v4.1

21 Jan 19:24
Compare
Choose a tag to compare

New Features

  • Added async support with function pangres.aupsert 🚀 ! Tested using aiosqlite for SQlite, asyncpg for PostgreSQL and aiomysql for MySQL. See documentation in dedicated wiki page

v4.0.2

17 Jan 19:52
Compare
Choose a tag to compare

This patches an important bug with MySQL. We recommend that all users upgrade to this version.

Bug Fixes

  • Fixed bug where tables in MySQL where created with auto increment on the primary key (see #56)

v4.0.1

13 Jan 13:22
Compare
Choose a tag to compare

Bug Fixes

  • removed warning due to deprecated code when checking versions of other libraries in Python >= 3.10 (see issue #54)

v4.0

12 Jan 21:49
Compare
Choose a tag to compare

There have been important changes in the main function pangres.upsert:

Breaking changes

  1. The first argument engine has been be renamed to con and now accepts engines and connections
  2. The argument chunksize now defaults to None. Like in pandas.DataFrame.to_sql we will attempt to insert all rows by default. Previously the default was 10000 rows.
  3. There will be no more automatic adjustments to the chunksize the user passes in pangres.upsert even if we can predict that it will raise an Exception due to database limitations.

E.g. inserting 100000 rows at once in a SQlite database with pangres will necessarily raise an Exception down the line because we need to pass NUMBER_OF_ROWS * NUMBER_OF_COLUMNS parameters and the maximum of parameters allowed in SQLite is 32766 (for version >= 3.32.0, otherwise it is 999).

I have made a new utility function pangres.adjust_chunksize that you can use before calling pangres.upsert if you want to make sure the chunksize is not too big.

New Features

Now that pangres.upsert accept connections objects this will give you more control when using it when it comes to connections and transactions.

See transaction control demo notebook.