diff --git a/executor/price_cache.py b/executor/price_cache.py index 2a83d42..e4b5a0e 100644 --- a/executor/price_cache.py +++ b/executor/price_cache.py @@ -62,16 +62,15 @@ def _open_universe_library(signals_bucket: str): those live in the `macro` library; use ``_open_macro_library`` for those. - Hard-fails on connection/library errors per feedback_no_silent_fails. + Thin wrapper over ``alpha_engine_lib.arcticdb.open_universe_lib`` — + the lib chokepoint (L2771) centralizes the S3 URI construction and + `get_library` error-wrapping across all alpha-engine consumers. + Kept as a local wrapper so the existing callers' import surface + stays unchanged and so the macOS allocator-prime invariant + (``import arcticdb`` at module top, BEFORE pandas) is preserved. """ - adb = _arcticdb # already imported at module top for macOS allocator prime - region = os.environ.get("AWS_REGION", "us-east-1") - uri = ( - f"s3s://s3.{region}.amazonaws.com:{signals_bucket}" - f"?path_prefix=arcticdb&aws_auth=true" - ) - arctic = adb.Arctic(uri) - return arctic.get_library("universe") + from alpha_engine_lib.arcticdb import open_universe_lib + return open_universe_lib(signals_bucket) def _open_macro_library(signals_bucket: str): @@ -82,16 +81,11 @@ def _open_macro_library(signals_bucket: str): and builders.backfill. SPY in particular is what the morning freshness gate and EOD reconcile check. - Hard-fails on connection/library errors per feedback_no_silent_fails. + Thin wrapper over ``alpha_engine_lib.arcticdb.open_macro_lib`` — + see ``_open_universe_library`` above for the rationale. """ - adb = _arcticdb - region = os.environ.get("AWS_REGION", "us-east-1") - uri = ( - f"s3s://s3.{region}.amazonaws.com:{signals_bucket}" - f"?path_prefix=arcticdb&aws_auth=true" - ) - arctic = adb.Arctic(uri) - return arctic.get_library("macro") + from alpha_engine_lib.arcticdb import open_macro_lib + return open_macro_lib(signals_bucket) def load_price_histories(