From 4dcd18d4ce5f3a4054fe7abfcd1356041916044a Mon Sep 17 00:00:00 2001 From: Nikolay Petrov Date: Mon, 8 Jun 2026 11:52:18 +0300 Subject: [PATCH 1/2] fix: strip duplicated resolution frame validation --- src/sources/infer.py | 4 ++-- src/sources/manifold.py | 5 ++--- src/sources/metaculus.py | 5 ++--- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/sources/infer.py b/src/sources/infer.py index 7cf88c10..2e232594 100644 --- a/src/sources/infer.py +++ b/src/sources/infer.py @@ -386,14 +386,14 @@ def _build_resolution_file( @staticmethod def _finalize_resolution_df(df: pd.DataFrame) -> DataFrame[ResolutionFrame]: - """Apply date filtering and return as validated ResolutionFrame. + """Apply date filtering and select resolution columns. Args: df (pd.DataFrame): Raw resolution data with id, date, value columns. """ df["date"] = pd.to_datetime(df["date"]) df = df[df["date"].dt.date >= constants.BENCHMARK_START_DATE_DATETIME_DATE] - return ResolutionFrame.validate(df[["id", "date", "value"]]) + return df[["id", "date", "value"]].astype(dtype=constants.RESOLUTION_FILE_COLUMN_DTYPE) # ------------------------------------------------------------------ # Private: question transformation diff --git a/src/sources/manifold.py b/src/sources/manifold.py index 9adbdf01..9eacaccb 100644 --- a/src/sources/manifold.py +++ b/src/sources/manifold.py @@ -407,11 +407,10 @@ def _build_resolution_file( @staticmethod def _finalize_resolution_df(df: pd.DataFrame) -> DataFrame[ResolutionFrame]: - """Filter to benchmark period and validate as ResolutionFrame.""" + """Filter to benchmark period and select resolution columns.""" df["date"] = pd.to_datetime(df["date"]) df = df[df["date"].dt.date >= constants.BENCHMARK_START_DATE_DATETIME_DATE] - df = df[["id", "date", "value"]].astype(dtype=constants.RESOLUTION_FILE_COLUMN_DTYPE) - return ResolutionFrame.validate(df) + return df[["id", "date", "value"]].astype(dtype=constants.RESOLUTION_FILE_COLUMN_DTYPE) @staticmethod def _get_resolved_market_value(market: dict) -> float: diff --git a/src/sources/metaculus.py b/src/sources/metaculus.py index c0eec80d..4931e76b 100644 --- a/src/sources/metaculus.py +++ b/src/sources/metaculus.py @@ -446,7 +446,7 @@ def set_date(end_datetime): @staticmethod def _finalize_resolution_df(df: pd.DataFrame) -> DataFrame[ResolutionFrame]: - """Cast types and return as a validated ResolutionFrame. + """Cast types and select resolution columns. Unlike infer/manifold, Metaculus does not filter to the benchmark start date: the aggregation history is already bounded by the question's open window, and @@ -455,5 +455,4 @@ def _finalize_resolution_df(df: pd.DataFrame) -> DataFrame[ResolutionFrame]: Args: df (pd.DataFrame): Raw resolution data with id, date, value columns. """ - df = df[["id", "date", "value"]].astype(dtype=constants.RESOLUTION_FILE_COLUMN_DTYPE) - return ResolutionFrame.validate(df) + return df[["id", "date", "value"]].astype(dtype=constants.RESOLUTION_FILE_COLUMN_DTYPE) From 11e33246d80153e2ad553e7cab673903a5dd3d96 Mon Sep 17 00:00:00 2001 From: Nikolay Petrov Date: Wed, 10 Jun 2026 10:15:23 +0300 Subject: [PATCH 2/2] fix: polymarket's duplicated validation --- src/sources/polymarket.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sources/polymarket.py b/src/sources/polymarket.py index 647a12dd..7cba9d4f 100644 --- a/src/sources/polymarket.py +++ b/src/sources/polymarket.py @@ -547,4 +547,4 @@ def _build_resolution_file(self, question: dict) -> DataFrame[ResolutionFrame]: df = pd.DataFrame(question["historical_prices"]) df["id"] = question["id"] df = df[["id", "date", "value"]].astype(dtype=constants.RESOLUTION_FILE_COLUMN_DTYPE) - return ResolutionFrame.validate(df) + return df