diff --git a/libs/research/src/market-data-store-duckdb.ts b/libs/research/src/market-data-store-duckdb.ts index 274b3353..5e4aac3a 100644 --- a/libs/research/src/market-data-store-duckdb.ts +++ b/libs/research/src/market-data-store-duckdb.ts @@ -2461,8 +2461,8 @@ function planCrossSectionInternal( `WHERE ${currencyPredicate} ` + 'AND b.session_date >= ? ' + 'AND b.session_date <= ? ' + - 'AND b.ts <= CAST(? AS TIMESTAMPTZ) ' + - 'AND b.known_at <= CAST(? AS TIMESTAMPTZ))', + 'AND b.ts <= ? ' + + 'AND b.known_at <= ?)', ]; const params: DuckDbParam[] = [ ...currencies, @@ -2490,9 +2490,9 @@ function planCrossSectionInternal( `${alias} AS (` + 'SELECT listing_id, CAST(value AS DOUBLE) AS value ' + `FROM read_parquet('${featPath}', hive_partitioning = true) ` + - 'WHERE ts >= CAST(? AS TIMESTAMPTZ) ' + - 'AND ts <= CAST(? AS TIMESTAMPTZ) ' + - 'AND known_at <= CAST(? AS TIMESTAMPTZ) ' + + 'WHERE ts >= ? ' + + 'AND ts <= ? ' + + 'AND known_at <= ? ' + 'QUALIFY ROW_NUMBER() OVER (PARTITION BY listing_id ORDER BY ts DESC, known_at DESC) = 1)' ); params.push(fromIso, toIso, asOfIso); diff --git a/python/tests/test_m2_sdk_parity.py b/python/tests/test_m2_sdk_parity.py index 852d7676..2e7bf56a 100644 --- a/python/tests/test_m2_sdk_parity.py +++ b/python/tests/test_m2_sdk_parity.py @@ -998,8 +998,10 @@ try {{ cwd=str(REPO_ROOT), capture_output=True, text=True, - check=True, ) + assert ( + proc.returncode == 0 + ), f"bun crossSection exited {proc.returncode}:\nstdout:\n{proc.stdout}\nstderr:\n{proc.stderr}" ts_payload = json.loads(proc.stdout.strip()) assert ts_payload["columns"] == cs.columns ts_rows = ts_payload["rows"]