Implement first storage layer#74
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 90e11de118
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| id INTEGER PRIMARY KEY DEFAULT nextval('price_bars_id_seq'), | ||
| source_id INTEGER NOT NULL, | ||
| instrument_id INTEGER NOT NULL, | ||
| timestamp DATE NOT NULL, |
There was a problem hiding this comment.
Preserve time precision for price bars
When this storage layer is used for non-daily data, such as the existing yfinance paths that accept "1h" and "15m" intervals, storing timestamp as DATE drops the time component. Because the uniqueness key includes this truncated value and insert_price_bar uses ON CONFLICT DO NOTHING, multiple intraday bars for the same source/instrument/day/timeframe collide and all but the first are silently skipped, corrupting the stored series; use a timestamp-capable type or reject intraday timeframes before insert.
Useful? React with 👍 / 👎.
What changed?
Related issue
Closes #38
Tests
pytestChecklist
Notes