fix(denoise): keep close columns as a list

This commit is contained in:
Emerson Gomes
2026-08-23 15:28:27 -05:00
parent 0b2fae536a
commit cbac5a9eb8
3 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -547,7 +547,7 @@ DenoiseMethodLiteral = Literal[_DENOISE_METHODS] # type: ignore
class DenoiseSpec(TypedDict, total=False):
method: DenoiseMethodLiteral # type: ignore
params: Dict[str, Any]
columns: List[str]
columns: Union[str, List[str]]
when: Literal['pre_ti', 'post_ti'] # type: ignore
causality: Literal['causal', 'zero_phase'] # type: ignore
keep_original: bool
+1 -1
View File
@@ -127,7 +127,7 @@ def normalize_denoise_pipeline_values(
_COLUMN_ALIASES_OHLC = frozenset({"ohlc"})
_COLUMN_ALIASES_CLOSE = frozenset({"price", "close"})
_COLUMN_ALIASES_CLOSE = frozenset({"price"})
_COLUMN_ALIASES_OHLCV = frozenset({"ohlcv"})
_COLUMN_ALIASES_ALL = frozenset({"all", "*", "numeric"})
_COLUMN_ALIASES = (
+4
View File
@@ -246,6 +246,10 @@ class TestNormalizeDenoiseSec:
out = normalize_denoise_spec({"method": "sma", "columns": "price"})
assert out["columns"] == "price"
def test_keeps_concrete_close_column_as_list(self):
out = normalize_denoise_spec({"method": "sma", "columns": ["close"]})
assert out["columns"] == ["close"]
def test_preserves_list_wrapped_alias(self):
out = normalize_denoise_spec({"method": "sma", "columns": ["ohlc"]})
assert out["columns"] == "ohlc"