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
{{ message }}
Repository navigation
variant() does not transfer expression behavior using the comparator correctly #3859
the Postgresql JSON needs a cast to compare JSON to string. Note that in JSON, foo['bar'] returns a JSON value, not string. not sure if there's any solution to that coming anytime soon.
Fixed issue in :class:.Variant where the "right hand coercion" logic,
inherited from :class:.TypeDecorator, would
coerce the right-hand side into the :class:.Variant itself, rather than
what the default type for the :class:.Variant would do. In the
case of :class:.Variant, we want the type to act mostly like the base
type so the default logic of :class:.TypeDecorator is now overridden
to fall back to the underlying wrapped type's logic. Is mostly relevant
for JSON at the moment.
This patch additionally adds documentation and basic tests to allow
for backend-agnostic comparison of JSON index elements to other objects.
A future version should attempt to improve upon this by providing
"astext", "asint" types of operators.
Activity
sqlalchemy-bot commentedon Nov 22, 2016
Changes by Michael Bayer (@zzzeek):
sqlalchemy-bot commentedon Nov 22, 2016
Changes by Michael Bayer (@zzzeek):
sqlalchemy-bot commentedon Nov 22, 2016
Changes by Michael Bayer (@zzzeek):
sqlalchemy-bot commentedon Nov 22, 2016
Michael Bayer (@zzzeek) wrote:
the Postgresql JSON needs a cast to compare JSON to string. Note that in JSON,
foo['bar']returns a JSON value, not string. not sure if there's any solution to that coming anytime soon.sqlalchemy-bot commentedon Nov 22, 2016
Michael Bayer (@zzzeek) wrote:
here's how to compare JSON elements in a backend-agnostic way for now:
adding this to the docs
sqlalchemy-bot commentedon Nov 22, 2016
Michael Bayer (@zzzeek) wrote:
Ensure Variant passes along impl right-hand type
Fixed issue in :class:
.Variantwhere the "right hand coercion" logic,inherited from :class:
.TypeDecorator, wouldcoerce the right-hand side into the :class:
.Variantitself, rather thanwhat the default type for the :class:
.Variantwould do. In thecase of :class:
.Variant, we want the type to act mostly like the basetype so the default logic of :class:
.TypeDecoratoris now overriddento fall back to the underlying wrapped type's logic. Is mostly relevant
for JSON at the moment.
This patch additionally adds documentation and basic tests to allow
for backend-agnostic comparison of JSON index elements to other objects.
A future version should attempt to improve upon this by providing
"astext", "asint" types of operators.
Change-Id: I7b7b45d604a4ae8d1dc236a5a1248695aab5232e
Fixes: #3859
→ df9b649
sqlalchemy-bot commentedon Nov 22, 2016
Changes by Michael Bayer (@zzzeek):