Problem
Calling options.expirations with columns=["expirations"] returns a DataFrame that looks empty, even
though the data is present — it's silently moved to the index.
Reproduction
from marketdata import MarketDataClient
df = MarketDataClient(token="...").options.expirations(
symbol="AAPL", columns=["expirations"]
)
print(df)
# Empty DataFrame
# Columns: []
# Index: [2025-12-05, 2025-12-12, ...]
Root cause
src/marketdata/resources/options/expirations.py:70 forces index_columns=["expirations"]. When the user
filters to only that column, the handler promotes the single column to the index, leaving zero data columns.
Suggested fix
Skip the set_index step when it would leave the DataFrame with zero columns (generic fix in the output
handler), or don't pass index_columns when the user explicitly filtered via columns.
Related (latent)
In INTERNAL output format, OptionsExpirations requires updated, so any partial response raises
__init__() missing 1 required positional argument: 'updated'. Worth making the field optional while in the
area.
Problem
Calling
options.expirationswithcolumns=["expirations"]returns a DataFrame that looks empty, eventhough the data is present — it's silently moved to the index.
Reproduction
Root cause
src/marketdata/resources/options/expirations.py:70forcesindex_columns=["expirations"]. When the userfilters to only that column, the handler promotes the single column to the index, leaving zero data columns.
Suggested fix
Skip the
set_indexstep when it would leave the DataFrame with zero columns (generic fix in the outputhandler), or don't pass
index_columnswhen the user explicitly filtered viacolumns.Related (latent)
In
INTERNALoutput format,OptionsExpirationsrequiresupdated, so any partial response raises__init__() missing 1 required positional argument: 'updated'. Worth making the field optional while in thearea.