T-212: merge dev

This commit is contained in:
Studio 2026-12-05 18:00:14 -05:00
commit 60ab228207
11 changed files with 5319 additions and 87 deletions

View file

@ -59,6 +59,7 @@ import {
parseAdjFactorsSnapshotMetadata as subpathParseAdjFactorsSnapshotMetadata,
planAdjFactorsMetadataQuery as subpathPlanAdjFactorsMetadataQuery,
planBars1dQuery as subpathPlanBars1dQuery,
planCrossSectionQuery as subpathPlanCrossSectionQuery,
planEventsQuery as subpathPlanEventsQuery,
planFundamentalsAsOfQuery as subpathPlanFundamentalsAsOfQuery,
planFx1dQuery as subpathPlanFx1dQuery,
@ -3409,6 +3410,8 @@ describe('planMacroAsOfQuery and store.macroAsOf', () => {
describe('planCrossSectionQuery and store.crossSection', () => {
it('plans survivorship-free universe join with versioned features, defaults omitted asOf to date, and rejects invalid/post-cutoff inputs', () => {
expect(subpathPlanCrossSectionQuery).toBe(planCrossSectionQuery);
const planned = planCrossSectionQuery(
{
features: ['ret_1d@v1', 'rsi_14@v2', 'ret_1d@v1'],
@ -3462,4 +3465,48 @@ describe('planCrossSectionQuery and store.crossSection', () => {
)
).toThrow(VaultHoldoutFenceError);
});
it('maps nullable feature values via store.crossSection and rejects invalid/post-cutoff requests with zero extra calls', async () => {
const fake = createRecordingExecutor({
onQuery: () => [
{ listing_id: 1, 'ret_1d@v1': 0.1, 'mom_diff@v1': 1.0 },
{ listing_id: 2, 'ret_1d@v1': null, 'mom_diff@v1': -5.0 },
],
});
const store = createDuckDbMarketDataStore({
executor: fake.executor,
curatedRoot: CURATED_ROOT,
vaultCutoffTs: CUTOFF_MS,
env: {},
});
const table = await store.crossSection({
features: ['ret_1d@v1', 'mom_diff@v1'],
date: '2025-01-02',
universe: 'US_EQ',
asOf: '2025-01-02T22:00:00Z',
});
expect(table.columns).toEqual(['listing_id', 'ret_1d@v1', 'mom_diff@v1']);
expect(table.rows).toEqual([
{ listing_id: 1, 'ret_1d@v1': 0.1, 'mom_diff@v1': 1.0 },
{ listing_id: 2, 'ret_1d@v1': null, 'mom_diff@v1': -5.0 },
]);
const beforeCalls = fake.calls.length;
await expect(
store.crossSection({
features: ['ret_1d@v1'],
date: '2026-05-28',
universe: 'US_EQ',
})
).rejects.toBeInstanceOf(VaultHoldoutFenceError);
await expect(
store.crossSection({
features: ['bad_ref'],
date: '2025-01-02',
universe: 'US_EQ',
})
).rejects.toBeInstanceOf(MarketDataStoreValidationError);
expect(fake.calls).toHaveLength(beforeCalls);
});
});