Spaces:
Sleeping
fix: key backfill snapshot_id on fiscalDateEnding, not the derived label
Browse filessnapshot_id was derived from target_period, which is DERIVED, not observed:
it is Alpha Vantage's fiscalDateEnding date string until a matching
quarterly row lands in metrics.db, then it flips to "Q{n}{YYYY}". ingest.py
adds such rows every quarter, so the next re-run of this backfill would
have minted new ids for those observations and appended them a second time
under the other label -- exactly the duplication Ruling 13 had to clean by
hand, in an archive whose only asset is being trustworthy.
Per Ruling 18 the fix is structural rather than a docstring caveat:
identity now comes from fiscalDateEnding, an observed provider fact that
never moves, which leaves target_period free to improve without forking the
record. The module docstring's idempotency claim is rewritten to match,
including the consequence -- a re-run after an ingest writes nothing, so an
archived label stays as first written and a consumer wanting the current
label joins on period_end_date.
The backfill half is regenerated under Ruling 13's guarded procedure: the
12 live_snapshot records were extracted, counted AND hashed
(6cd06284bd4b6a7c237e54c7903dcaefe28684bce9bf1fb772b32bda455590c2), written
back byte-for-byte in original order, then re-counted and re-hashed before
the backfill was re-run once. Both assertions held on both sides.
Final archive: 629 records = 12 live (hash unchanged) + 617 backfill
(38 matched, 579 fallback), 629 unique snapshot_ids, no FY-labelled record
claiming matched provenance. Only 38 lines changed: for the 579 fallback
records target_period already WAS the fiscalDateEnding, so their ids are
unaffected -- the 38 that moved are precisely the ones the old scheme would
have duplicated at the next ingest.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
- data/consensus_snapshots.jsonl +38 -38
- scripts/backfill_consensus.py +25 -2
- tests/test_backfill_consensus.py +76 -0
|
@@ -10,21 +10,21 @@
|
|
| 10 |
{"basis": "gaap", "capture_kind": "live_snapshot", "captured_at": "2026-08-28T09:00:14.395380+00:00", "currency": "USD", "metric": "revenue", "period_basis": "quarter", "provider": "yfinance", "provider_period_code": "0q", "snapshot_id": "cs_90e5446ef74df303bbc1b03f", "target_period": "Q22027", "target_period_source": "derived_from_latest_reported", "ticker": "NVDA", "value": 104434313520.0}
|
| 11 |
{"basis": "adjusted", "capture_kind": "live_snapshot", "captured_at": "2026-08-28T09:00:14.713252+00:00", "currency": "USD", "metric": "eps", "period_basis": "quarter", "provider": "yfinance", "provider_period_code": "0q", "snapshot_id": "cs_beeb7679d0ff7198c0d38b98", "target_period": "Q32026", "target_period_source": "derived_from_latest_reported", "ticker": "TSLA", "value": 0.45154}
|
| 12 |
{"basis": "gaap", "capture_kind": "live_snapshot", "captured_at": "2026-08-28T09:00:14.713252+00:00", "currency": "USD", "metric": "revenue", "period_basis": "quarter", "provider": "yfinance", "provider_period_code": "0q", "snapshot_id": "cs_e6f2233f95c3bcfdb24577e4", "target_period": "Q32026", "target_period_source": "derived_from_latest_reported", "ticker": "TSLA", "value": 27521550990.0}
|
| 13 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2026-07-30", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2026-06-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 14 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2026-04-30", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2026-03-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 15 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2026-01-29", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2025-12-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 16 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2025-10-30", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2025-09-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_a4f72d77c93227fbd28632d9", "target_period": "2025-09-30", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "AAPL", "value": 1.77}
|
| 17 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2025-07-31", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2025-06-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 18 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2025-05-01", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2025-03-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 19 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2025-01-30", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2024-12-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 20 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2024-10-31", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2024-09-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_c5b9c698abad6e96fcfbceea", "target_period": "2024-09-30", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "AAPL", "value": 0.95}
|
| 21 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2024-08-01", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2024-06-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 22 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2024-05-02", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2024-03-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 23 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2024-02-01", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2023-12-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 24 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2023-11-02", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2023-09-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_3b67bc8c8e8ccef8a8144c25", "target_period": "2023-09-30", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "AAPL", "value": 1.39}
|
| 25 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2023-08-03", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2023-06-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 26 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2023-05-04", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2023-03-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 27 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2023-02-02", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2022-12-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 28 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2022-10-27", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2022-09-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_ee3ca7e7b4f75e63f31912a7", "target_period": "2022-09-30", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "AAPL", "value": 1.27}
|
| 29 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2022-07-28", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2022-06-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_f0c69c5c698eac36481f38c5", "target_period": "2022-06-30", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "AAPL", "value": 1.15}
|
| 30 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2022-04-28", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2022-03-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_33105c9e7b36414e01c188a5", "target_period": "2022-03-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "AAPL", "value": 1.43}
|
|
@@ -244,19 +244,19 @@
|
|
| 244 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "1996-10-07", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "1996-09-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_7a9a6f3818087c6ad6146bd6", "target_period": "1996-09-30", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "AMD", "value": -0.18}
|
| 245 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "1996-07-10", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "1996-06-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_1194088eef5d2d59d78e4f29", "target_period": "1996-06-30", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "AMD", "value": -0.11}
|
| 246 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "1996-04-09", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "1996-03-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_2145cd30d177ff27d1520f01", "target_period": "1996-03-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "AMD", "value": 0.15}
|
| 247 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2026-07-22", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2026-06-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 248 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2026-04-29", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2026-03-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 249 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2026-02-04", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2025-12-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_ff1704652e092d6557120bc5", "target_period": "2025-12-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "GOOGL", "value": 2.63}
|
| 250 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2025-10-29", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2025-09-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 251 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2025-07-23", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2025-06-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 252 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2025-04-24", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2025-03-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 253 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2025-02-04", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2024-12-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_9b927d34977c1f72136fb879", "target_period": "2024-12-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "GOOGL", "value": 2.13}
|
| 254 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2024-10-29", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2024-09-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 255 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2024-07-23", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2024-06-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 256 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2024-04-25", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2024-03-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 257 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2024-01-30", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2023-12-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_458f897bb8c39864ed0d6d3e", "target_period": "2023-12-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "GOOGL", "value": 1.59}
|
| 258 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2023-10-24", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2023-09-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 259 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2023-07-25", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2023-06-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 260 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2023-04-25", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2023-03-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_3bb2dcf532c8d7d832354bb5", "target_period": "2023-03-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "GOOGL", "value": 1.07}
|
| 261 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2023-02-02", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2022-12-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_6640d3e3043ca2849f5e188f", "target_period": "2022-12-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "GOOGL", "value": 1.19}
|
| 262 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2022-10-25", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2022-09-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_a08fc11112db619de60f9248", "target_period": "2022-09-30", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "GOOGL", "value": 1.25}
|
|
@@ -455,22 +455,22 @@
|
|
| 455 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "1996-07-22", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "1996-06-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_2ecbd9e780d3a6e6730ce321", "target_period": "1996-06-30", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "MSFT", "value": 0.05}
|
| 456 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "1996-04-18", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "1996-03-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_4af7aa1cc30e9b9bdec987d1", "target_period": "1996-03-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "MSFT", "value": 0.05}
|
| 457 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2026-08-26", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2026-07-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_1414f012d1e6f42d6d303efb", "target_period": "2026-07-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "NVDA", "value": 2.09}
|
| 458 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2026-05-20", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2026-04-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 459 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2026-02-25", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2026-01-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_7289b3c8b3ec7b1190cd2e86", "target_period": "2026-01-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "NVDA", "value": 1.54}
|
| 460 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2025-11-19", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2025-10-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 461 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2025-08-27", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2025-07-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 462 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2025-05-28", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2025-04-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 463 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2025-02-26", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2025-01-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_80698b5e0076956a81fc99d1", "target_period": "2025-01-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "NVDA", "value": 0.85}
|
| 464 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2024-11-20", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2024-10-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 465 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2024-08-28", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2024-07-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 466 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2024-05-22", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2024-04-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 467 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2024-02-21", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2024-01-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_964584a1acd0440c40570b51", "target_period": "2024-01-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "NVDA", "value": 0.461}
|
| 468 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2023-11-21", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2023-10-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 469 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2023-08-23", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2023-07-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 470 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2023-05-24", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2023-04-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 471 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2023-02-22", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2023-01-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_c4eb6a4403a21a8b73bc592e", "target_period": "2023-01-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "NVDA", "value": 0.081}
|
| 472 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2022-11-16", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2022-10-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 473 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2022-08-24", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2022-07-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 474 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2022-05-25", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2022-04-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_6c3c0a300795e83c65a03642", "target_period": "2022-04-30", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "NVDA", "value": 0.13}
|
| 475 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2022-02-16", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2022-01-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_206e75ced25641a1612e5f61", "target_period": "2022-01-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "NVDA", "value": 0.123}
|
| 476 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2021-11-17", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2021-10-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_ecde5f22c47f0bcafcfdd620", "target_period": "2021-10-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "NVDA", "value": 0.111}
|
|
@@ -563,7 +563,7 @@
|
|
| 563 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "1999-11-18", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "1999-10-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_0737fac1fc3a37434916d7af", "target_period": "1999-10-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "NVDA", "value": 0.002}
|
| 564 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "1999-08-18", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "1999-07-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_5977dc6b550e175afd815dbc", "target_period": "1999-07-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "NVDA", "value": 0.002}
|
| 565 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "1999-05-18", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "1999-04-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_924d06bcfb987ee8bff942bd", "target_period": "1999-04-30", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "NVDA", "value": 0.001}
|
| 566 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2026-07-22", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2026-06-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 567 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2026-04-22", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2026-03-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_0d43eccdc3902fc4164051cd", "target_period": "2026-03-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "TSLA", "value": 0.35}
|
| 568 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2026-01-28", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2025-12-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_2b059991a46a62d838976107", "target_period": "2025-12-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "TSLA", "value": 0.45}
|
| 569 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2025-10-22", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2025-09-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_40f762e206521228f8f9f85b", "target_period": "2025-09-30", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "TSLA", "value": 0.56}
|
|
@@ -575,10 +575,10 @@
|
|
| 575 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2024-04-23", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2024-03-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_6c90344107da4ca7eb6997f1", "target_period": "2024-03-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "TSLA", "value": 0.51}
|
| 576 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2024-01-24", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2023-12-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_dda911ca011612dd3e5b0df5", "target_period": "2023-12-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "TSLA", "value": 0.74}
|
| 577 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2023-10-18", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2023-09-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_b3880b0a07070b3346ec275f", "target_period": "2023-09-30", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "TSLA", "value": 0.73}
|
| 578 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2023-07-19", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2023-06-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 579 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2023-04-19", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2023-03-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 580 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2023-01-25", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2022-12-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_530fb7c8203d414e9c1f4c58", "target_period": "2022-12-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "TSLA", "value": 1.11}
|
| 581 |
-
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2022-10-19", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2022-09-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "
|
| 582 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2022-07-20", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2022-06-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_78590bcff0447d9c44ecce09", "target_period": "2022-06-30", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "TSLA", "value": 0.6}
|
| 583 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2022-04-20", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2022-03-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_3398fe7a036c8e36c5c440a9", "target_period": "2022-03-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "TSLA", "value": 0.75}
|
| 584 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2022-01-26", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2021-12-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_9ec858a4c54c9195209625a9", "target_period": "2021-12-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "TSLA", "value": 0.79}
|
|
|
|
| 10 |
{"basis": "gaap", "capture_kind": "live_snapshot", "captured_at": "2026-08-28T09:00:14.395380+00:00", "currency": "USD", "metric": "revenue", "period_basis": "quarter", "provider": "yfinance", "provider_period_code": "0q", "snapshot_id": "cs_90e5446ef74df303bbc1b03f", "target_period": "Q22027", "target_period_source": "derived_from_latest_reported", "ticker": "NVDA", "value": 104434313520.0}
|
| 11 |
{"basis": "adjusted", "capture_kind": "live_snapshot", "captured_at": "2026-08-28T09:00:14.713252+00:00", "currency": "USD", "metric": "eps", "period_basis": "quarter", "provider": "yfinance", "provider_period_code": "0q", "snapshot_id": "cs_beeb7679d0ff7198c0d38b98", "target_period": "Q32026", "target_period_source": "derived_from_latest_reported", "ticker": "TSLA", "value": 0.45154}
|
| 12 |
{"basis": "gaap", "capture_kind": "live_snapshot", "captured_at": "2026-08-28T09:00:14.713252+00:00", "currency": "USD", "metric": "revenue", "period_basis": "quarter", "provider": "yfinance", "provider_period_code": "0q", "snapshot_id": "cs_e6f2233f95c3bcfdb24577e4", "target_period": "Q32026", "target_period_source": "derived_from_latest_reported", "ticker": "TSLA", "value": 27521550990.0}
|
| 13 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2026-07-30", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2026-06-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_566696adabb1b2d6e85ac961", "target_period": "Q32026", "target_period_source": "matched_metrics_report_date", "ticker": "AAPL", "value": 1.88}
|
| 14 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2026-04-30", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2026-03-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_821da0817270bf96e8d4d45b", "target_period": "Q22026", "target_period_source": "matched_metrics_report_date", "ticker": "AAPL", "value": 1.94}
|
| 15 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2026-01-29", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2025-12-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_88abd0e2b2a740736041fa50", "target_period": "Q12026", "target_period_source": "matched_metrics_report_date", "ticker": "AAPL", "value": 2.67}
|
| 16 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2025-10-30", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2025-09-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_a4f72d77c93227fbd28632d9", "target_period": "2025-09-30", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "AAPL", "value": 1.77}
|
| 17 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2025-07-31", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2025-06-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_b9bdf605ab3cd056a195274d", "target_period": "Q32025", "target_period_source": "matched_metrics_report_date", "ticker": "AAPL", "value": 1.43}
|
| 18 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2025-05-01", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2025-03-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_e2ff2f9a107628f84a5b22db", "target_period": "Q22025", "target_period_source": "matched_metrics_report_date", "ticker": "AAPL", "value": 1.62}
|
| 19 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2025-01-30", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2024-12-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_625aea75c24fdbcb0654e666", "target_period": "Q12025", "target_period_source": "matched_metrics_report_date", "ticker": "AAPL", "value": 2.34}
|
| 20 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2024-10-31", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2024-09-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_c5b9c698abad6e96fcfbceea", "target_period": "2024-09-30", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "AAPL", "value": 0.95}
|
| 21 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2024-08-01", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2024-06-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_9f8c949d24b4d855b26cb4a1", "target_period": "Q32024", "target_period_source": "matched_metrics_report_date", "ticker": "AAPL", "value": 1.34}
|
| 22 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2024-05-02", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2024-03-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_3ea4d5014f9751d3ca09ccfb", "target_period": "Q22024", "target_period_source": "matched_metrics_report_date", "ticker": "AAPL", "value": 1.5}
|
| 23 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2024-02-01", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2023-12-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_88a9ebaaa7a1e3b0b77d0e24", "target_period": "Q12024", "target_period_source": "matched_metrics_report_date", "ticker": "AAPL", "value": 2.11}
|
| 24 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2023-11-02", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2023-09-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_3b67bc8c8e8ccef8a8144c25", "target_period": "2023-09-30", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "AAPL", "value": 1.39}
|
| 25 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2023-08-03", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2023-06-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_5c346bc4f29a044c0c494da4", "target_period": "Q32023", "target_period_source": "matched_metrics_report_date", "ticker": "AAPL", "value": 1.19}
|
| 26 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2023-05-04", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2023-03-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_208bdd3d7a905371acc60949", "target_period": "Q22023", "target_period_source": "matched_metrics_report_date", "ticker": "AAPL", "value": 1.43}
|
| 27 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2023-02-02", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2022-12-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_b952fffd5cbd1f4416c72034", "target_period": "Q12023", "target_period_source": "matched_metrics_report_date", "ticker": "AAPL", "value": 1.95}
|
| 28 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2022-10-27", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2022-09-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_ee3ca7e7b4f75e63f31912a7", "target_period": "2022-09-30", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "AAPL", "value": 1.27}
|
| 29 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2022-07-28", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2022-06-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_f0c69c5c698eac36481f38c5", "target_period": "2022-06-30", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "AAPL", "value": 1.15}
|
| 30 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2022-04-28", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2022-03-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_33105c9e7b36414e01c188a5", "target_period": "2022-03-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "AAPL", "value": 1.43}
|
|
|
|
| 244 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "1996-10-07", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "1996-09-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_7a9a6f3818087c6ad6146bd6", "target_period": "1996-09-30", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "AMD", "value": -0.18}
|
| 245 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "1996-07-10", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "1996-06-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_1194088eef5d2d59d78e4f29", "target_period": "1996-06-30", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "AMD", "value": -0.11}
|
| 246 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "1996-04-09", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "1996-03-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_2145cd30d177ff27d1520f01", "target_period": "1996-03-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "AMD", "value": 0.15}
|
| 247 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2026-07-22", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2026-06-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_56f469dbbb1c2a8e5aec97a2", "target_period": "Q22026", "target_period_source": "matched_metrics_report_date", "ticker": "GOOGL", "value": 2.88}
|
| 248 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2026-04-29", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2026-03-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_03c1c27813241e6b0424e3f2", "target_period": "Q12026", "target_period_source": "matched_metrics_report_date", "ticker": "GOOGL", "value": 2.53}
|
| 249 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2026-02-04", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2025-12-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_ff1704652e092d6557120bc5", "target_period": "2025-12-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "GOOGL", "value": 2.63}
|
| 250 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2025-10-29", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2025-09-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_82c1c3375b286ee2d334fabc", "target_period": "Q32025", "target_period_source": "matched_metrics_report_date", "ticker": "GOOGL", "value": 2.32}
|
| 251 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2025-07-23", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2025-06-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_d18d2d80afbd82194130aaa3", "target_period": "Q22025", "target_period_source": "matched_metrics_report_date", "ticker": "GOOGL", "value": 2.19}
|
| 252 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2025-04-24", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2025-03-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_aa58a305c9aada595017c72b", "target_period": "Q12025", "target_period_source": "matched_metrics_report_date", "ticker": "GOOGL", "value": 2.01}
|
| 253 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2025-02-04", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2024-12-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_9b927d34977c1f72136fb879", "target_period": "2024-12-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "GOOGL", "value": 2.13}
|
| 254 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2024-10-29", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2024-09-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_7468b967bf624bf3f9622d7b", "target_period": "Q32024", "target_period_source": "matched_metrics_report_date", "ticker": "GOOGL", "value": 1.85}
|
| 255 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2024-07-23", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2024-06-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_2a4e3b4c252d3e6211b85946", "target_period": "Q22024", "target_period_source": "matched_metrics_report_date", "ticker": "GOOGL", "value": 1.85}
|
| 256 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2024-04-25", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2024-03-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_50aabeef40eddd50b3c99572", "target_period": "Q12024", "target_period_source": "matched_metrics_report_date", "ticker": "GOOGL", "value": 1.51}
|
| 257 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2024-01-30", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2023-12-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_458f897bb8c39864ed0d6d3e", "target_period": "2023-12-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "GOOGL", "value": 1.59}
|
| 258 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2023-10-24", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2023-09-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_36ff9086cb80cbabde249e9e", "target_period": "Q32023", "target_period_source": "matched_metrics_report_date", "ticker": "GOOGL", "value": 1.45}
|
| 259 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2023-07-25", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2023-06-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_0c87fe8d73870d37f30b002a", "target_period": "Q22023", "target_period_source": "matched_metrics_report_date", "ticker": "GOOGL", "value": 1.34}
|
| 260 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2023-04-25", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2023-03-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_3bb2dcf532c8d7d832354bb5", "target_period": "2023-03-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "GOOGL", "value": 1.07}
|
| 261 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2023-02-02", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2022-12-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_6640d3e3043ca2849f5e188f", "target_period": "2022-12-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "GOOGL", "value": 1.19}
|
| 262 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2022-10-25", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2022-09-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_a08fc11112db619de60f9248", "target_period": "2022-09-30", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "GOOGL", "value": 1.25}
|
|
|
|
| 455 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "1996-07-22", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "1996-06-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_2ecbd9e780d3a6e6730ce321", "target_period": "1996-06-30", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "MSFT", "value": 0.05}
|
| 456 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "1996-04-18", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "1996-03-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_4af7aa1cc30e9b9bdec987d1", "target_period": "1996-03-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "MSFT", "value": 0.05}
|
| 457 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2026-08-26", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2026-07-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_1414f012d1e6f42d6d303efb", "target_period": "2026-07-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "NVDA", "value": 2.09}
|
| 458 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2026-05-20", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2026-04-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_b8b83bb10c887d9267bc245e", "target_period": "Q12027", "target_period_source": "matched_metrics_report_date", "ticker": "NVDA", "value": 1.77}
|
| 459 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2026-02-25", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2026-01-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_7289b3c8b3ec7b1190cd2e86", "target_period": "2026-01-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "NVDA", "value": 1.54}
|
| 460 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2025-11-19", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2025-10-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_720dd593e7c48cc304425ad8", "target_period": "Q32026", "target_period_source": "matched_metrics_report_date", "ticker": "NVDA", "value": 1.26}
|
| 461 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2025-08-27", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2025-07-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_955d21769ca5b708e57a8596", "target_period": "Q22026", "target_period_source": "matched_metrics_report_date", "ticker": "NVDA", "value": 1.01}
|
| 462 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2025-05-28", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2025-04-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_99ed87a757647a1290d9082d", "target_period": "Q12026", "target_period_source": "matched_metrics_report_date", "ticker": "NVDA", "value": 0.75}
|
| 463 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2025-02-26", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2025-01-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_80698b5e0076956a81fc99d1", "target_period": "2025-01-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "NVDA", "value": 0.85}
|
| 464 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2024-11-20", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2024-10-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_4d137658cf4245473b73b9aa", "target_period": "Q32025", "target_period_source": "matched_metrics_report_date", "ticker": "NVDA", "value": 0.75}
|
| 465 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2024-08-28", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2024-07-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_4b4a0eaf81a98c1e7946befb", "target_period": "Q22025", "target_period_source": "matched_metrics_report_date", "ticker": "NVDA", "value": 0.63}
|
| 466 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2024-05-22", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2024-04-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_0c509d1cf0fae020f6f85caa", "target_period": "Q12025", "target_period_source": "matched_metrics_report_date", "ticker": "NVDA", "value": 0.559}
|
| 467 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2024-02-21", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2024-01-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_964584a1acd0440c40570b51", "target_period": "2024-01-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "NVDA", "value": 0.461}
|
| 468 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2023-11-21", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2023-10-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_09af304ed4c157b7502c1b47", "target_period": "Q32024", "target_period_source": "matched_metrics_report_date", "ticker": "NVDA", "value": 0.336}
|
| 469 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2023-08-23", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2023-07-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_15630abe6adae4ab638fa2be", "target_period": "Q22024", "target_period_source": "matched_metrics_report_date", "ticker": "NVDA", "value": 0.207}
|
| 470 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2023-05-24", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2023-04-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_7180139ad83a407fe2224a8b", "target_period": "Q12024", "target_period_source": "matched_metrics_report_date", "ticker": "NVDA", "value": 0.092}
|
| 471 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2023-02-22", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2023-01-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_c4eb6a4403a21a8b73bc592e", "target_period": "2023-01-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "NVDA", "value": 0.081}
|
| 472 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2022-11-16", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2022-10-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_a9a0503c51cd5182f830e3e4", "target_period": "Q32023", "target_period_source": "matched_metrics_report_date", "ticker": "NVDA", "value": 0.071}
|
| 473 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2022-08-24", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2022-07-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_605d9dabced17f47c750a908", "target_period": "Q22023", "target_period_source": "matched_metrics_report_date", "ticker": "NVDA", "value": 0.0499}
|
| 474 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2022-05-25", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2022-04-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_6c3c0a300795e83c65a03642", "target_period": "2022-04-30", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "NVDA", "value": 0.13}
|
| 475 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2022-02-16", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2022-01-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_206e75ced25641a1612e5f61", "target_period": "2022-01-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "NVDA", "value": 0.123}
|
| 476 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2021-11-17", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2021-10-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_ecde5f22c47f0bcafcfdd620", "target_period": "2021-10-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "NVDA", "value": 0.111}
|
|
|
|
| 563 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "1999-11-18", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "1999-10-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_0737fac1fc3a37434916d7af", "target_period": "1999-10-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "NVDA", "value": 0.002}
|
| 564 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "1999-08-18", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "1999-07-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_5977dc6b550e175afd815dbc", "target_period": "1999-07-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "NVDA", "value": 0.002}
|
| 565 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "1999-05-18", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "1999-04-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_924d06bcfb987ee8bff942bd", "target_period": "1999-04-30", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "NVDA", "value": 0.001}
|
| 566 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2026-07-22", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2026-06-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_1b85a7e09935df46aa8ff12d", "target_period": "Q22026", "target_period_source": "matched_metrics_report_date", "ticker": "TSLA", "value": 0.32}
|
| 567 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2026-04-22", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2026-03-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_0d43eccdc3902fc4164051cd", "target_period": "2026-03-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "TSLA", "value": 0.35}
|
| 568 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2026-01-28", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2025-12-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_2b059991a46a62d838976107", "target_period": "2025-12-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "TSLA", "value": 0.45}
|
| 569 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2025-10-22", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2025-09-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_40f762e206521228f8f9f85b", "target_period": "2025-09-30", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "TSLA", "value": 0.56}
|
|
|
|
| 575 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2024-04-23", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2024-03-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_6c90344107da4ca7eb6997f1", "target_period": "2024-03-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "TSLA", "value": 0.51}
|
| 576 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2024-01-24", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2023-12-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_dda911ca011612dd3e5b0df5", "target_period": "2023-12-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "TSLA", "value": 0.74}
|
| 577 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2023-10-18", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2023-09-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_b3880b0a07070b3346ec275f", "target_period": "2023-09-30", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "TSLA", "value": 0.73}
|
| 578 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2023-07-19", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2023-06-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_8c395549e9b1aa5ef84c8aca", "target_period": "Q22023", "target_period_source": "matched_metrics_report_date", "ticker": "TSLA", "value": 0.82}
|
| 579 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2023-04-19", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2023-03-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_09ec3877726a9c64cf9c9a32", "target_period": "Q12023", "target_period_source": "matched_metrics_report_date", "ticker": "TSLA", "value": 0.85}
|
| 580 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2023-01-25", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2022-12-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_530fb7c8203d414e9c1f4c58", "target_period": "2022-12-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "TSLA", "value": 1.11}
|
| 581 |
+
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2022-10-19", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2022-09-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_0c8f9f57517c6594f9dbd1ef", "target_period": "Q32022", "target_period_source": "matched_metrics_report_date", "ticker": "TSLA", "value": 1.0}
|
| 582 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2022-07-20", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2022-06-30", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_78590bcff0447d9c44ecce09", "target_period": "2022-06-30", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "TSLA", "value": 0.6}
|
| 583 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2022-04-20", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2022-03-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_3398fe7a036c8e36c5c440a9", "target_period": "2022-03-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "TSLA", "value": 0.75}
|
| 584 |
{"basis": "adjusted", "capture_kind": "backfill_at_report", "captured_at": "2022-01-26", "currency": "USD", "metric": "eps", "period_basis": "quarter", "period_end_date": "2021-12-31", "provider": "alphavantage", "provider_period_code": null, "snapshot_id": "cs_9ec858a4c54c9195209625a9", "target_period": "2021-12-31", "target_period_source": "alphavantage_fiscal_date_ending", "ticker": "TSLA", "value": 0.79}
|
|
@@ -52,7 +52,20 @@ finds no partner and keeps the date-string fallback.
|
|
| 52 |
still preserved in the archive for the calibration backtest, which needs
|
| 53 |
it more than it needs the label to resolve.
|
| 54 |
|
| 55 |
-
Idempotent:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
"""
|
| 57 |
from __future__ import annotations
|
| 58 |
|
|
@@ -167,8 +180,18 @@ def backfill(ticker: str) -> tuple[int, int, int]:
|
|
| 167 |
# have been observed. It is deliberately NOT treated as pre-release.
|
| 168 |
captured_at = reported_date or ending
|
| 169 |
records.append({
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 170 |
"snapshot_id": snapshot_id(
|
| 171 |
-
ticker,
|
| 172 |
),
|
| 173 |
"ticker": ticker.upper(),
|
| 174 |
"target_period": period,
|
|
|
|
| 52 |
still preserved in the archive for the calibration backtest, which needs
|
| 53 |
it more than it needs the label to resolve.
|
| 54 |
|
| 55 |
+
Idempotent: snapshot_id is derived from the OBSERVED identity of the
|
| 56 |
+
estimate -- ticker, Alpha Vantage's fiscalDateEnding, metric, provider,
|
| 57 |
+
captured_at -- and never from target_period, which is derived and moves.
|
| 58 |
+
target_period starts as the fiscalDateEnding string and becomes a
|
| 59 |
+
"Q{n}{YYYY}" label as soon as ingest.py adds the matching quarterly row,
|
| 60 |
+
so keying identity on it would mint a new id for the same observation at
|
| 61 |
+
the next quarterly ingest and double-write it under two labels. Keyed on
|
| 62 |
+
the period end instead, a re-run produces identical ids, which the store
|
| 63 |
+
skips. Note the consequence: a re-run after an ingest recognises the
|
| 64 |
+
record as already present and writes nothing at all, so the archived
|
| 65 |
+
target_period stays whatever it was when first written. That is the
|
| 66 |
+
correct behaviour for an append-only log -- period_end_date is on every
|
| 67 |
+
backfill record, so a consumer that wants the current label joins on
|
| 68 |
+
that rather than trusting a label frozen at write time.
|
| 69 |
"""
|
| 70 |
from __future__ import annotations
|
| 71 |
|
|
|
|
| 180 |
# have been observed. It is deliberately NOT treated as pre-release.
|
| 181 |
captured_at = reported_date or ending
|
| 182 |
records.append({
|
| 183 |
+
# Identity comes from fiscalDateEnding (stored below as
|
| 184 |
+
# period_end_date), NOT from target_period. target_period is
|
| 185 |
+
# DERIVED: it is this same date string until a matching quarterly
|
| 186 |
+
# row lands in metrics.db, at which point it becomes
|
| 187 |
+
# "Q{n}{YYYY}". ingest.py adds such rows every quarter, so an id
|
| 188 |
+
# keyed on the label would change under a re-run and append the
|
| 189 |
+
# same observation a second time under the other name -- the
|
| 190 |
+
# duplication Ruling 13 had to clean by hand. fiscalDateEnding is
|
| 191 |
+
# an observed provider fact and never moves, which leaves
|
| 192 |
+
# target_period free to improve without forking the record.
|
| 193 |
"snapshot_id": snapshot_id(
|
| 194 |
+
ticker, ending, "eps", "alphavantage", captured_at
|
| 195 |
),
|
| 196 |
"ticker": ticker.upper(),
|
| 197 |
"target_period": period,
|
|
@@ -161,3 +161,79 @@ def test_valid_entry_with_matching_fiscal_date_ending_is_written_and_counted(wir
|
|
| 161 |
monkeypatch.setattr(backfill_mod, "fetch_earnings", lambda t: (payload, None))
|
| 162 |
written, matched, fallback = backfill_mod.backfill("NVDA")
|
| 163 |
assert (written, matched, fallback) == (1, 1, 0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 161 |
monkeypatch.setattr(backfill_mod, "fetch_earnings", lambda t: (payload, None))
|
| 162 |
written, matched, fallback = backfill_mod.backfill("NVDA")
|
| 163 |
assert (written, matched, fallback) == (1, 1, 0)
|
| 164 |
+
|
| 165 |
+
|
| 166 |
+
def test_snapshot_id_survives_target_period_flipping_to_a_q_label(
|
| 167 |
+
wired, monkeypatch, tmp_path
|
| 168 |
+
):
|
| 169 |
+
"""The idempotency regression.
|
| 170 |
+
|
| 171 |
+
target_period is DERIVED: it is the fiscalDateEnding date string until a
|
| 172 |
+
matching quarterly row lands in metrics.db, then it becomes "Q{n}{YYYY}".
|
| 173 |
+
ingest.py adds such rows every quarter. While snapshot_id was derived
|
| 174 |
+
from target_period, a re-run after an ingest minted a NEW id for the same
|
| 175 |
+
observation and appended it a second time under the other label -- which
|
| 176 |
+
is exactly the duplication Ruling 13 had to clean by hand.
|
| 177 |
+
|
| 178 |
+
Identity therefore comes from fiscalDateEnding, a stable observed fact,
|
| 179 |
+
leaving target_period free to improve without forking the record.
|
| 180 |
+
"""
|
| 181 |
+
backfill_mod, consensus_path = wired
|
| 182 |
+
import storage.forecast_store as store
|
| 183 |
+
import storage.metrics_db as metrics_db
|
| 184 |
+
|
| 185 |
+
payload = {
|
| 186 |
+
"quarterlyEarnings": [
|
| 187 |
+
{
|
| 188 |
+
# No metrics row is within 7 days of this yet, so the first
|
| 189 |
+
# run labels it with the raw date string.
|
| 190 |
+
"fiscalDateEnding": "2027-03-28",
|
| 191 |
+
"reportedDate": "2027-04-29",
|
| 192 |
+
"estimatedEPS": "1.05",
|
| 193 |
+
}
|
| 194 |
+
]
|
| 195 |
+
}
|
| 196 |
+
monkeypatch.setattr(backfill_mod, "fetch_earnings", lambda t: (payload, None))
|
| 197 |
+
|
| 198 |
+
written, matched, fallback = backfill_mod.backfill("NVDA")
|
| 199 |
+
assert (written, matched, fallback) == (1, 0, 1)
|
| 200 |
+
first = store.read_snapshots(ticker="NVDA")[0]
|
| 201 |
+
assert first["target_period"] == "2027-03-28"
|
| 202 |
+
|
| 203 |
+
# A quarter passes; ingest.py writes the 10-Q row for it.
|
| 204 |
+
metrics_db.upsert_metrics({
|
| 205 |
+
"ticker": "NVDA", "period": "Q12027", "report_date": "2027-03-28",
|
| 206 |
+
})
|
| 207 |
+
|
| 208 |
+
written_again, matched_again, _ = backfill_mod.backfill("NVDA")
|
| 209 |
+
assert written_again == 0, "the same observation must not be written twice"
|
| 210 |
+
assert matched_again == 1 # the label now resolves; the identity does not move
|
| 211 |
+
rows = store.read_snapshots(ticker="NVDA")
|
| 212 |
+
assert len(rows) == 1
|
| 213 |
+
assert rows[0]["snapshot_id"] == first["snapshot_id"]
|
| 214 |
+
|
| 215 |
+
|
| 216 |
+
def test_snapshot_id_is_derived_from_the_period_end_date(wired, monkeypatch):
|
| 217 |
+
"""Stated as an explicit identity contract so a future edit that reverts
|
| 218 |
+
to the derived label fails here rather than in the archive."""
|
| 219 |
+
backfill_mod, consensus_path = wired
|
| 220 |
+
import storage.forecast_store as store
|
| 221 |
+
|
| 222 |
+
payload = {
|
| 223 |
+
"quarterlyEarnings": [
|
| 224 |
+
{
|
| 225 |
+
"fiscalDateEnding": "2026-06-27",
|
| 226 |
+
"reportedDate": "2026-07-30",
|
| 227 |
+
"estimatedEPS": "1.05",
|
| 228 |
+
}
|
| 229 |
+
]
|
| 230 |
+
}
|
| 231 |
+
monkeypatch.setattr(backfill_mod, "fetch_earnings", lambda t: (payload, None))
|
| 232 |
+
backfill_mod.backfill("NVDA")
|
| 233 |
+
|
| 234 |
+
row = store.read_snapshots(ticker="NVDA")[0]
|
| 235 |
+
assert row["target_period"] == "Q32026" # label resolved via the join
|
| 236 |
+
assert row["period_end_date"] == "2026-06-27"
|
| 237 |
+
assert row["snapshot_id"] == store.snapshot_id(
|
| 238 |
+
"NVDA", "2026-06-27", "eps", "alphavantage", "2026-07-30"
|
| 239 |
+
)
|