Skip to content

Commit

Permalink
Fixup optional args
Browse files Browse the repository at this point in the history
  • Loading branch information
asmacdo committed Feb 9, 2025
1 parent 653e01b commit 6d2f4a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/con_duct/suite/ls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 6d2f4a4

Please sign in to comment.