feat: resolve issues #158, #160, #163, #164#169
Merged
BigBen-7 merged 1 commit intoLead-Studios:mainfrom Mar 26, 2026
Merged
Conversation
…#163, Lead-Studios#164 - Lead-Studios#164: Centralise DB engine into src/db.py singleton with pool_size=5, max_overflow=10, pool_timeout=30, pool_recycle=1800; add POOL_SIZE and POOL_MAX_OVERFLOW env vars; replace all scattered create_engine calls in analytics/models.py, etl/__init__.py, and report_service.py; add GET /health/db endpoint returning pool stats. - Lead-Studios#158: Extend SearchEventsRequest with min_price, max_price, max_capacity fields; update extract_keywords to detect price-intent NLP signals (free, cheap, affordable → max_price; premium, VIP → min_price); update filter_events_by_keywords to apply price and capacity filters with explicit params overriding NLP hints. - Lead-Studios#160: Add AnalyticsService.get_trending_events(limit, hours) querying ticket_scans by scan velocity in the last 24 h, joined with event_sales_summary for names; 10-minute in-memory cache; expose via GET /events/trending?limit=10. - Lead-Studios#163: Add diff_etl_output(event_rows, daily_rows) helper in etl/__init__.py comparing transformed rows against current Postgres data and returning would_insert/would_update/unchanged counts; expose via admin-only GET /etl/diff with async 202 fallback for slow extracts (>5 s). - Tests: test_db_pooling.py, test_search_filters.py, test_trending_events.py, test_etl_diff.py covering all new features.
|
@TomikeDS Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
BigBen-7
approved these changes
Mar 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: add database connection pooling configuration and connection health checks #164: Centralise DB engine into src/db.py singleton with pool_size=5, max_overflow=10, pool_timeout=30, pool_recycle=1800; add POOL_SIZE and POOL_MAX_OVERFLOW env vars; replace all scattered create_engine calls in analytics/models.py, etl/init.py, and report_service.py; add GET /health/db endpoint returning pool stats.
feat: add price range and capacity filters to
/search-events#158: Extend SearchEventsRequest with min_price, max_price, max_capacity fields; update extract_keywords to detect price-intent NLP signals (free, cheap, affordable → max_price; premium, VIP → min_price); update filter_events_by_keywords to apply price and capacity filters with explicit params overriding NLP hints.feat: add
GET /events/trending— top events by scan velocity in the last 24 hours #160: Add AnalyticsService.get_trending_events(limit, hours) querying ticket_scans by scan velocity in the last 24 h, joined with event_sales_summary for names; 10-minute in-memory cache; expose via GET /events/trending?limit=10.feat: add
GET /etl/diff— show what the next ETL run would load without committing #163: Add diff_etl_output(event_rows, daily_rows) helper in etl/init.py comparing transformed rows against current Postgres data and returning would_insert/would_update/unchanged counts; expose via admin-only GET /etl/diff with async 202 fallback for slow extracts (>5 s).Tests: test_db_pooling.py, test_search_filters.py, test_trending_events.py, test_etl_diff.py covering all new features.
Description
Closes #164
closes #158
closes #160
closes #163
Checklist
docs/api-reference.md,docs/etl-pipeline.md)black,isort, andmypypass locally