Releases: ThibTrip/pangres
v4.2.1
v4.2.0
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
- added minimal example in wiki. Thanks to @triberichard (see issue #74)
Development
v4.1.4
Bug Fixes
- fixed compatibility with
pandas==2.0.0
. Thanks to @lordsutch
v4.1.3
Bug Fixes
pangres
is now compatible withsqlalchemy>=2.0
. IMPORTANT: you will needalembic>=1.7.2
(it is one of the dependencies ofpangres
) 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
Bug Fixes
-
pangres
was not running on Python 3.10 because I never addedpackaging
inrequirements.txt
. I fixed it by usingpkg_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 usespackaging
(so I never saw the missing dependency)
v4.1.1
Bug Fixes
- fixed bug where I used a synchronous method instead of its asynchronous variant (
UpsertQuery.execute
instead ofUpsertQuery.aexecute
inpangres.aupsert
). This has no repercussions for the end user
Documentation
- fix illogic code in example for
pangres.aupsert
(usingengine
instead ofconnection
in contexts) andcommit
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 totest_core
v4.1
v4.0.2
v4.0.1
v4.0
There have been important changes in the main function pangres.upsert
:
Breaking changes
- The first argument
engine
has been be renamed tocon
and now accepts engines and connections - The argument
chunksize
now defaults toNone
. Like inpandas.DataFrame.to_sql
we will attempt to insert all rows by default. Previously the default was10000
rows. - There will be no more automatic adjustments to the
chunksize
the user passes inpangres.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.