cmu-delphi/delphi-epidata

Improve handling of queries beyond the row limit

オープン

#1,020 opened on 2022/11/01

 (1 件のコメント) (0 件のリアクション) (0 人の担当者)Python (67 件のフォーク)auto 404
code healthhelp wantedrefactor

Repository metrics

Stars
 (104 個のスター)
PR merge metrics
 (平均マージ 63d 20h) (30d で 11 merged PRs)

説明

Previously, we would process a full query until it hit the limit and then just return nothing to the user

https://github.com/cmu-delphi/delphi-epidata/blob/9844600b0de41f7d8e93bfb7d7dff7e0740b0792/src/server/_printer.py#L90-L99

Then I added a LIMIT clause, but in an unintuitive place

https://github.com/cmu-delphi/delphi-epidata/blob/9844600b0de41f7d8e93bfb7d7dff7e0740b0792/src/server/_query.py#L238-L248

  • The LIMIT addition should probably be in the QueryBuilder object.
  • The row counting might be obsolete since the LIMIT query should handle that (cc @melange396 to confirm). Update: the row counting in the printer is needed when dealing with multiple SQL queries; interestingly, these are only used in non-covidcast endpoints
  • run_query probably doesn't need the p: APrinter then.

コントリビューターガイド