Shadow Ingest DataFrame Contract¶
This page describes what users should expect from the returned polars.DataFrame objects.
Common Contract¶
For all dataframe-returning public APIs:
- the public return type is
polars.DataFrame - transport choice is hidden from users
- schema should stay stable at the level of core identifying columns
- pandas users can convert explicitly with
df.to_pandas()
gather_daily_price(...)¶
Stable core columns:
trade_date: Datestock_code: String- requested price fields such as
open,close,volume
Behavior:
- one row per
trade_date x stock_code - requested field subset is respected
trade_dateis normalized to a date-like dataframe type across transportstotal_turnoverrefers to traded value, not share volume
gather_daily_snapshot(...)¶
Stable core columns:
trade_date: Datestock_code: String
Behavior:
- one trading date per call
- cross-sectional dataframe for the requested stock list
- rows are naturally understood as
trade_date x stock_code - additional fields depend on the snapshot dataset
gather_financial_snapshot(...)¶
Stable core column:
stock_code
Behavior:
- returns the latest snapshot available for each requested stock code
- financial statement columns depend on
statement_type - result may be empty if the upstream financial PIT dataset is empty or incomplete
get_industry_mapping(...)¶
Stable core columns:
trade_date: Datestock_code: Stringstock_name: String | Nullstandard: String
Behavior:
- one row per matching
stock_codewithin the selected standard and date - public results always expose
stock_code, even if the backing dataset usesorder_book_id - hierarchy columns include first-, second-, and third-level industry code/name pairs
get_industry_members(...)¶
Stable core columns:
trade_date: Datestock_code: Stringstock_name: String | Nullstandard: String
Behavior:
- returns member rows for one matched industry definition
- the same stable hierarchy columns are returned as
get_industry_mapping(...) stock_nameis joined fromcommon_stock.symbolfor the same trade date