Skip to content

Commit

Permalink
fix(cache): sqlalchemy.exc.ArgumentError from selecting counts
Browse files Browse the repository at this point in the history
  • Loading branch information
BlinkyStitt authored Aug 24, 2023
1 parent def9103 commit 6bdce6a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ape_cache/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def _estimate_query_clause(self, query: QueryType) -> Select:
@_estimate_query_clause.register
def _block_estimate_query_clause(self, query: BlockQuery) -> Select:
return (
select([func.count()])
select(func.count())
.select_from(Blocks)
.where(Blocks.number >= query.start_block)
.where(Blocks.number <= query.stop_block)
Expand All @@ -183,15 +183,15 @@ def _block_estimate_query_clause(self, query: BlockQuery) -> Select:
@_estimate_query_clause.register
def _transaction_estimate_query_clause(self, query: BlockTransactionQuery) -> Select:
return (
select([func.count()])
select(func.count())
.select_from(Transactions)
.where(Transactions.block_hash == query.block_id)
)

@_estimate_query_clause.register
def _contract_events_estimate_query_clause(self, query: ContractEventQuery) -> Select:
return (
select([func.count()])
select(func.count())
.select_from(ContractEvents)
.where(ContractEvents.block_number >= query.start_block)
.where(ContractEvents.block_number <= query.stop_block)
Expand Down

0 comments on commit 6bdce6a

Please sign in to comment.