data timeout fixes; research agent improvements

This commit is contained in:
2026-04-24 20:43:42 -04:00
parent 1800363566
commit 319d81c41f
37 changed files with 672 additions and 280 deletions

View File

@@ -20,6 +20,7 @@ OHLC_OPTIONAL_COLUMNS = [
"volume", "buy_vol", "sell_vol",
"open_time", "high_time", "low_time", "close_time",
"open_interest",
"num_trades", "quote_volume",
]
# All valid extra columns available in the Iceberg schema
@@ -27,6 +28,7 @@ VALID_EXTRA_COLUMNS = {
"volume", "buy_vol", "sell_vol",
"open_time", "high_time", "low_time", "close_time",
"open_interest",
"num_trades", "quote_volume",
"ticker", "period_seconds"
}
@@ -51,7 +53,7 @@ class DataAPIImpl(DataAPI):
s3_access_key: Optional[str] = None,
s3_secret_key: Optional[str] = None,
s3_region: Optional[str] = None,
request_timeout: float = 30.0,
request_timeout: float = 120.0,
):
"""
Initialize DataAPI implementation.
@@ -65,7 +67,7 @@ class DataAPIImpl(DataAPI):
s3_access_key: S3/MinIO access key
s3_secret_key: S3/MinIO secret key
s3_region: S3/MinIO region (e.g., "us-east-1")
request_timeout: Default timeout for historical data requests in seconds (default: 30)
request_timeout: Default timeout for historical data requests in seconds (default: 120)
"""
self.ohlc_client = OHLCClient(
iceberg_catalog_uri=iceberg_catalog_uri,

View File

@@ -90,7 +90,7 @@ class OHLCClient:
period_seconds: int,
start_time: int,
end_time: int,
request_timeout: float = 30.0
request_timeout: float = 120.0
) -> pd.DataFrame:
"""
Fetch OHLC data with smart caching.
@@ -108,7 +108,7 @@ class OHLCClient:
period_seconds: OHLC period in seconds (60, 300, 3600, etc.)
start_time: Start timestamp in nanoseconds
end_time: End timestamp in nanoseconds
request_timeout: Timeout for historical data requests (default: 30s)
request_timeout: Timeout for historical data requests (default: 120s)
Returns:
DataFrame with OHLC data sorted by timestamp
@@ -180,6 +180,12 @@ class OHLCClient:
if col in df.columns:
df[col] = df[col] / size_divisor
if price_precision is not None and price_precision > 0:
price_divisor = 10 ** price_precision
for col in ("quote_volume",):
if col in df.columns:
df[col] = df[col] / price_divisor
return df
async def __aenter__(self):