Additional background: In the proposed code snippet, I placed the
try/except around the `begin_nested()` block instead of just the
`orm_session.add()` statement because the `add()` might not get flushed to
database until the savepoint is released in the event the session is not
auto-flushing.
Thanks Mike! I followed up on your suggestion concerning savepoints and
came up with the following code snippet. Does this look right to you?
```
try:
with orm_session.begin_nested():
orm_session.add(record)
except psycopg2.errors.UniqueViolation as error: # or is it
it's not simple to work with a criteria object since you would have to walk
through it to make some programmatic decision about it, and you'd also have to
search for it.I can't completely guarantee this wont change so it would be
better if you solved your problem differently, but here's how
In the case of using the PropComparator.and_() operator
(https://docs.sqlalchemy.org/en/14/orm/loading_relationships.html#adding-criteria-to-loader-options),
is there any way to then introspect the relationship to tell what if any
and_ filtering has been applied to the load?
For example on a,
Thanks, Mike! I have some studying to do...
On Wednesday, February 3, 2021 at 6:42:17 PM UTC-5 Mike Bayer wrote:
>
>
> On Wed, Feb 3, 2021, at 6:23 PM, Christian Henning wrote:
>
> Hi Mike,
>
> thanks for your advice! I'll make the changes.
>
> But let me ask you one thing. My classmethod
Ah, OK, so the real problem is that the teradata package is trying to
load a .so file from site-packages.zip and failing. This presumably
happens when the module is imported, and Python is catching the
underlying exception and raising an ImportError instead.
It sounds like the teradata package is