From c25081b8eaa839884cf86df69f87aade9b6e8f2e Mon Sep 17 00:00:00 2001 From: Steve Phelps Date: Sat, 21 Oct 2023 08:29:06 +0100 Subject: [PATCH] Revert "Always configure the pipeline_loader instead of custom_loader when choosing a loader, since the latter is always None (fixes #218)" This reverts commit 8165debac21e0330c0e6365cdbcf278d2354de3d. --- src/zipline/utils/run_algo.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/zipline/utils/run_algo.py b/src/zipline/utils/run_algo.py index fc87741a12..8ef95fab38 100644 --- a/src/zipline/utils/run_algo.py +++ b/src/zipline/utils/run_algo.py @@ -176,8 +176,13 @@ def _run( bundle_data.adjustment_reader, ) - def choose_loader(_column): - return pipeline_loader + def choose_loader(column): + if column in USEquityPricing.columns: + return pipeline_loader + try: + return custom_loader.get(column) + except KeyError: + raise ValueError("No PipelineLoader registered for column %s." % column) if isinstance(metrics_set, str): try: