Here are the examples of the python api sqlalchemy.any_ taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
7 Examples
3
Source : queries.py
with MIT License
from bihealth
with MIT License
from bihealth
def extend_conditions(self, _query_parts):
for token, fn in (("block", operator.ne), ("allow", operator.eq)):
if self.kwargs["gene_%slist" % token]:
hgnc_ids = [
hgnc.id
for hgnc in Hgnc.objects.filter(
Q(symbol__in=self.kwargs["gene_%slist" % token])
| Q(entrez_id__in=self.kwargs["gene_%slist" % token])
| Q(ensembl_gene_id__in=self.kwargs["gene_%slist" % token])
)
]
if (token == "block" and hgnc_ids) or (token == "allow"):
yield fn(Hgnc.sa.id, any_(hgnc_ids))
def extend_selectable(self, query_parts):
3
Source : test_query.py
with Apache License 2.0
from gethue
with Apache License 2.0
from gethue
def test_any_w_comparator(self):
stuff = self.tables.stuff
stmt = select([stuff.c.id]).where(
stuff.c.value > any_(select([stuff.c.value]))
)
eq_(testing.db.execute(stmt).fetchall(), [(2,), (3,), (4,), (5,)])
def test_all_w_comparator(self):
3
Source : test_types.py
with Apache License 2.0
from gethue
with Apache License 2.0
from gethue
def test_any_all_exprs_array(self):
stmt = select(
[
3
== any_(
func.array_cat(
array([1, 2, 3]),
array([4, 5, 6]),
type_=self.ARRAY(Integer),
)
)
]
)
eq_(testing.db.execute(stmt).scalar(), True)
def test_insert_array(self):
3
Source : test_query.py
with MIT License
from sqlalchemy
with MIT License
from sqlalchemy
def test_any_w_comparator(self, connection):
stuff = self.tables.stuff
stmt = select(stuff.c.id).where(
stuff.c.value > any_(select(stuff.c.value).scalar_subquery())
)
eq_(connection.execute(stmt).fetchall(), [(2,), (3,), (4,), (5,)])
def test_all_w_comparator(self, connection):
3
Source : test_types.py
with MIT License
from sqlalchemy
with MIT License
from sqlalchemy
def test_any_all_exprs_array(self, connection):
stmt = select(
3
== any_(
func.array_cat(
array([1, 2, 3]),
array([4, 5, 6]),
type_=self.ARRAY(Integer),
)
)
)
eq_(connection.execute(stmt).scalar(), True)
def test_insert_array(self, connection):
0
Source : test_query.py
with Apache License 2.0
from gethue
with Apache License 2.0
from gethue
def test_any_literal(self):
stuff = self.tables.stuff
stmt = select([4 == any_(select([stuff.c.value]))])
is_(testing.db.execute(stmt).scalar(), True)
0
Source : test_query.py
with MIT License
from sqlalchemy
with MIT License
from sqlalchemy
def test_any_literal(self, connection):
stuff = self.tables.stuff
stmt = select(4 == any_(select(stuff.c.value).scalar_subquery()))
is_(connection.execute(stmt).scalar(), True)