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
I am migrating lots of data from mongodb to postgresql using ponyorm in custom migration script.
After some work it fails with this error:
Traceback (most recent call last):
File "orm.py", line 252, in <module>
migrate_botdata(bot_db.common, newbot)
File "orm.py", line 226, in migrate_botdata
block_msg=block,
File "<string>", line 2, in __init__
File "/home/paul/tmp/mpb_migration/env/lib/python3.4/site-packages/pony/utils/utils.py", line 58, in cut_traceback
return func(*args, **kwargs)
File "/home/paul/tmp/mpb_migration/env/lib/python3.4/site-packages/pony/orm/core.py", line 4199, in __init__
entity._get_from_identity_map_(pkval, 'created', undo_funcs=undo_funcs, obj_to_init=obj)
File "/home/paul/tmp/mpb_migration/env/lib/python3.4/site-packages/pony/orm/core.py", line 3992, in _get_from_identity_map_
if attr.reverse: attr.update_reverse(obj, NOT_LOADED, val, undo_funcs)
File "/home/paul/tmp/mpb_migration/env/lib/python3.4/site-packages/pony/orm/core.py", line 2131, in update_reverse
if new_val is not None: reverse.__set__(new_val, obj, undo_funcs)
File "<string>", line 2, in __set__ File "/home/paul/tmp/mpb_migration/env/lib/python3.4/site-packages/pony/utils/utils.py", line 58, in cut_traceback
return func(*args, **kwargs) File "/home/paul/tmp/mpb_migration/env/lib/python3.4/site-packages/pony/orm/core.py", line 2000, in __set__ old_val = attr.load(obj)
File "/home/paul/tmp/mpb_migration/env/lib/python3.4/site-packages/pony/orm/core.py", line 1936, in load
dbval = reverse.entity._find_in_db_({reverse : obj})
File "/home/paul/tmp/mpb_migration/env/lib/python3.4/site-packages/pony/orm/core.py", line 3730, in _find_in_db_
objects = entity._fetch_objects(cursor, attr_offsets, 1, for_update, avdict)
File "/home/paul/tmp/mpb_migration/env/lib/python3.4/site-packages/pony/orm/core.py", line 3862, in _fetch_objects
obj._db_set_(avdict)
File "/home/paul/tmp/mpb_migration/env/lib/python3.4/site-packages/pony/orm/core.py", line 4367, in _db_set_
assert obj._status_ not in created_or_deleted_statuses
AssertionError
I understand that there can be duplicates in my old data which can violate constraints in posgresql, but how am i supposed to find them basing on that error?
The text was updated successfully, but these errors were encountered:
# New features
* All arguments of db.bind() can be specified as keyword arguments. Previously Pony required the first positional argument which specified the database provider. Now you can pass all the database parameters using the dict: db.bind(**db_params). See https://docs.ponyorm.com/api_reference.html#Database.bind
* The `optimistic` attribute option is added https://docs.ponyorm.com/api_reference.html#cmdoption-arg-optimistic
# Bugfixes
* Fixes#219: when a database driver raises an error, sometimes this error was masked by the 'RollbackException: InterfaceError: connection already closed' exception. This happened because on error, Pony tried to rollback transaction, but the connection to the database was already closed and it masked the initial error. Now Pony displays the original error which helps to understand the cause of the problem.
* Fixes#276: Memory leak
* Fixes the __all__ declaration. Previously IDEs, such as PyCharm, could not understand what is going to be imported by 'from pony.orm import *'. Now it works fine.
* Fixes#232: negate check for numeric expressions now checks if value is zero or NULL
* Fixes#238, fixes#133: raise TransactionIntegrityError exception instead of AssertionError if obj.collection.create(**kwargs) creates a duplicate object
* Fixes#221: issue with unicode json path keys
* Fixes bug when discriminator column is used as a part of a primary key
* Handle situation when SQLite blob column contains non-binary value
I am migrating lots of data from mongodb to postgresql using ponyorm in custom migration script.
After some work it fails with this error:
I understand that there can be duplicates in my old data which can violate constraints in posgresql, but how am i supposed to find them basing on that error?
The text was updated successfully, but these errors were encountered: