ci: fix lint errors across project, update ruff.toml per-file ignores
This commit is contained in:
@@ -1,4 +1,10 @@
|
||||
import asyncio, asyncpg, json, os, redis
|
||||
import asyncio
|
||||
import json
|
||||
import os
|
||||
|
||||
import asyncpg
|
||||
import redis
|
||||
|
||||
|
||||
async def main():
|
||||
pool = await asyncpg.create_pool(
|
||||
@@ -9,20 +15,20 @@ async def main():
|
||||
password=os.environ["POSTGRES_PASSWORD"],
|
||||
)
|
||||
r = redis.from_url(f"redis://:{os.environ.get('REDIS_PASSWORD', '')}@{os.environ['REDIS_HOST']}:{os.environ['REDIS_PORT']}/0")
|
||||
|
||||
|
||||
rows = await pool.fetch(
|
||||
"SELECT d.id, dcm.ticker FROM documents d "
|
||||
"LEFT JOIN document_company_mentions dcm ON d.id = dcm.document_id "
|
||||
"WHERE d.source_type = 'news_api' AND d.parse_quality_score > 0.7 "
|
||||
"ORDER BY d.parse_quality_score DESC LIMIT 5"
|
||||
)
|
||||
|
||||
|
||||
for row in rows:
|
||||
r.rpush("stonks:queue:extraction", json.dumps({
|
||||
"document_id": str(row["id"]),
|
||||
"ticker": row["ticker"] or "",
|
||||
}))
|
||||
|
||||
|
||||
print(f"Enqueued {len(rows)} high-quality docs for re-extraction")
|
||||
await pool.close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user