From 6d2f4a4af701f76d5198db15ee32528243d4ceb0 Mon Sep 17 00:00:00 2001 From: Austin Macdonald Date: Sun, 9 Feb 2025 13:03:24 -0600 Subject: [PATCH] Fixup optional args --- src/con_duct/suite/ls.py | 6 ++++-- test/test_suite.py | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/con_duct/suite/ls.py b/src/con_duct/suite/ls.py index da222fa..f4b6ff2 100644 --- a/src/con_duct/suite/ls.py +++ b/src/con_duct/suite/ls.py @@ -55,7 +55,9 @@ MINIMUM_SCHEMA_VERSION: str = "0.2.0" -def load_duct_runs(info_files: List[str], eval_filter: str) -> List[Dict[str, Any]]: +def load_duct_runs( + info_files: List[str], eval_filter: Optional[str] = None +) -> List[Dict[str, Any]]: loaded: List[Dict[str, Any]] = [] for info_file in info_files: with open(info_file) as file: @@ -70,7 +72,7 @@ def load_duct_runs(info_files: List[str], eval_filter: str) -> List[Dict[str, An f"is below minimum schema version {MINIMUM_SCHEMA_VERSION}." ) continue - if eval_filter and not eval( + if eval_filter is not None and not eval( eval_filter, _flatten_dict(this), dict(re=re) ): continue diff --git a/test/test_suite.py b/test/test_suite.py index 4c5c488..9eb9afb 100644 --- a/test/test_suite.py +++ b/test/test_suite.py @@ -4,7 +4,7 @@ import json import os import tempfile -from typing import Any +from typing import Any, Optional import unittest from unittest.mock import MagicMock, mock_open, patch import pytest @@ -184,7 +184,7 @@ def tearDown(self) -> None: self.temp_dir.cleanup() def _run_ls( - self, paths: list[str], fmt: str, args: argparse.Namespace = None + self, paths: list[str], fmt: str, args: Optional[argparse.Namespace] = None ) -> str: """Helper function to run ls() and capture stdout.""" if args is None: