T-139: M2.4a — Versioned Feature Library core: declarative DuckDB SQL feature definitions + registerSignal registry + versioned Parquet batch-plan runner over an injected DuckDbExecutor in libs/research/src/feature-library.ts (pure, no new deps)
This commit is contained in:
parent
c4083a8f32
commit
0cdc231579
2 changed files with 17 additions and 17 deletions
|
|
@ -1493,21 +1493,8 @@ describe('QA round 4: CTE scope must match DuckDB identifier folding (ASCII-only
|
|||
for (const sql of unicodeFoldProbes) {
|
||||
const def = makeSimpleDef({ name: 'leak', sql });
|
||||
|
||||
for (const attempt of [
|
||||
() => validateFeatureDefinition(def),
|
||||
() => createFeatureRegistry().registerSignal(def),
|
||||
]) {
|
||||
let error: unknown;
|
||||
try {
|
||||
attempt();
|
||||
} catch (caught) {
|
||||
error = caught;
|
||||
}
|
||||
expect(error).toBeInstanceOf(FeatureLibraryError);
|
||||
expect(['EXTERNAL_DATA_ACCESS', 'INVALID_SQL_STATEMENT']).toContain(
|
||||
(error as FeatureLibraryError).code
|
||||
);
|
||||
}
|
||||
expectFeatureErrorCode(() => validateFeatureDefinition(def), 'EXTERNAL_DATA_ACCESS');
|
||||
expectFeatureErrorCode(() => createFeatureRegistry().registerSignal(def), 'EXTERNAL_DATA_ACCESS');
|
||||
|
||||
const fake = createRecordingFakeExecutor();
|
||||
let execError: unknown;
|
||||
|
|
@ -1521,6 +1508,7 @@ describe('QA round 4: CTE scope must match DuckDB identifier folding (ASCII-only
|
|||
execError = error;
|
||||
}
|
||||
expect(execError).toBeInstanceOf(FeatureLibraryError);
|
||||
expect((execError as FeatureLibraryError).code).toBe('EXTERNAL_DATA_ACCESS');
|
||||
expect(fake.calls).toHaveLength(0);
|
||||
}
|
||||
});
|
||||
|
|
@ -1533,4 +1521,11 @@ describe('QA round 4: CTE scope must match DuckDB identifier folding (ASCII-only
|
|||
});
|
||||
expect(() => validateFeatureDefinition(def)).not.toThrow();
|
||||
});
|
||||
|
||||
it('accepts an exact non-ASCII quoted CTE name match', () => {
|
||||
const def = makeSimpleDef({
|
||||
sql: 'WITH "Ä" AS (SELECT listing_id, ts, close FROM {{input:bars_1d}}) SELECT listing_id, ts, ts AS known_at, close AS value FROM "Ä"',
|
||||
});
|
||||
expect(() => validateFeatureDefinition(def)).not.toThrow();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue