On Thu, Apr 13, 2023, at 4:14 PM, Luis Del Rio IV wrote:
> Mike,
>
> Would this select query be able to get our aggregated data?
>
> query =
> select(func.max(DataModel.value)).select_from(_query.subquery()).group_by(
> func.date_format(DataModel.timestamp, "%Y-%m-%d %H")
>
On Thu, Apr 13, 2023, at 1:13 PM, Peter Harrison wrote:
> Thanks Mike,
>
> Ideally we'd prefer to find a solution via Graphene-SQLAlchemy. Unfortunately
> we don't have the luxury of creating our own query when interacting with
> Graphene-SQLAlchemy.
>
> So the key question for us is, can you
Mike,
Would this select query be able to get our aggregated data?
query = select(func.max(DataModel.value)).select_from(_query
.subquery()).group_by(
func.date_format(DataModel.timestamp, "%Y-%m-%d %H")
)
We tried this route but are now getting this error
"errors":
Thanks Mike,
Ideally we'd prefer to find a solution via Graphene-SQLAlchemy.
Unfortunately we don't have the luxury of creating our own query when
interacting with Graphene-SQLAlchemy.
So the key question for us is, can you modify an existing
sqlalchemy.orm.query.Query object to insert a "func
On Wed, Apr 12, 2023, at 5:21 PM, Luis Del Rio IV wrote:
> I am currently using the following sqlalchemy code,
>
> _query = super().get_query(model, info, sort, **args)
> query = _query.group_by(
> func.date_format(DataModel.timestamp, "%Y-%m-%d %H")
> )
>
I am currently using the following sqlalchemy code,
_query = super().get_query(model, info, sort, **args)
query = _query.group_by(
func.date_format(DataModel.timestamp, "%Y-%m-%d %H")
)
return query
I am trying to aggregate the the max value of a field
I'm using sqlalchemy 0.6.6 and sqlite 3.6.22 on Python 2.6. When I do:
In [1]: for i in ses.query(UserSnapshot):
...: print i
...: if i is None: break
...:
I see:
...
None
My schema:
class User(Base):
__tablename
Are there performance difference between the following line of codes.
a. for instance in Query:
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, sen
I am a bit confused by the behavior for the methods all() and one() if
the Query would return an empty result set. In the case of all() it
returns an empty list whereas one() will throw an exception
(sqlalchemy.exceptions.InvalidRequestError). I am sure there was a
reason to implement as it is now