Skip to content

fix: qualify agents_preprocess model refs with analysis dataset (#141)#148

Merged
C00ldudeNoonan merged 1 commit into
mainfrom
fix/issue-141-reddit-dataset
Jul 12, 2026
Merged

fix: qualify agents_preprocess model refs with analysis dataset (#141)#148
C00ldudeNoonan merged 1 commit into
mainfrom
fix/issue-141-reddit-dataset

Conversation

@C00ldudeNoonan

Copy link
Copy Markdown
Owner

Summary

reddit_daily_summary_job failed on every run with 404 Not found: ... economics_raw_dev.agent_reddit_posts_daily. The query referenced the agent_reddit_posts_daily dbt model by bare table name, but BigQueryWarehouseResource.execute_query() resolves unqualified names against its default economics_raw dataset — while agents_preprocess models materialize into economics_analysis.

This PR qualifies those references using default_dataset_for_schema("economics_analysis"), the same environment-suffix helper introduced for the staging-dataset fix in #143.

Changes

Scope note

A repo-wide sweep found the same defect class in ~60 more bare agent_* references across economy_state/ (data_access.py, domain_data_fetchers.py, economy_state_charts.py), investments/investment_recommendation_charts.py, and narratives/economic_narrative_assets.py. Those are not in this PR — kept tight to #141's named scope. Filed as a follow-up issue.

Testing

  • pytest tests/test_bigquery_parameterized_callers.py — 6 passed (4 existing + 2 new)
  • pytest tests/test_data_point_finder.py — 25 passed

Closes #141

🤖 Generated with Claude Code

reddit_daily_summary and query_data_for_findings queried dbt models
(agent_reddit_posts_daily, agent_reddit_sentiment_trends, etc.) by bare
table name. BigQueryWarehouseResource.execute_query resolves unqualified
names against its default economics_raw dataset, but agents_preprocess
models materialize into economics_analysis, so every run failed with
404 Not found.

Qualify these references with default_dataset_for_schema(
"economics_analysis") — the same environment-suffix helper used for the
staging-dataset fix in #143 — and add caller tests asserting the
qualification.

Closes #141

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@C00ldudeNoonan
C00ldudeNoonan merged commit 45bf4b8 into main Jul 12, 2026
1 check passed
@C00ldudeNoonan
C00ldudeNoonan deleted the fix/issue-141-reddit-dataset branch July 12, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

reddit_daily_summary_job: queries agent_reddit_posts_daily in wrong dataset (economics_raw instead of economics_analysis)

1 participant