Skip to content

Commit 3257fef

Browse files
committed
ensure tests will pass if no mcp dependencies are installed, install the dependencies in ci so the tests will run there
1 parent 6385b4d commit 3257fef

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

src/fenic/core/mcp/types.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ class BoundToolParam:
8787
data_type: DataType
8888
required: bool
8989
has_default: bool
90-
default_value: Optional[ToolParameterType]
91-
allowed_values: Optional[List[ToolParameterType]]
92-
constraints: Optional[ToolParamConstraints]
93-
validators: List[ParamValidator]
90+
default_value: Optional[ToolParameterType] = None
91+
allowed_values: Optional[List[ToolParameterType]] = None
92+
constraints: Optional[ToolParamConstraints] = None
93+
validators: List[ParamValidator] = Field(default_factory=list)
9494

9595

9696
@dataclass(config=ConfigDict(arbitrary_types_allowed=True))

tests/api/mcp/test_server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import pytest
44

5+
pytest.importorskip("fastmcp")
6+
57
from fenic.api.functions import col, tool_param
68
from fenic.api.mcp.server import create_mcp_server
79
from fenic.api.mcp.tool_generation import auto_generate_system_tools_from_tables
@@ -14,7 +16,6 @@
1416

1517

1618
def test_server_generation_with_parameterized_tools(local_session: Session):
17-
pytest.importorskip("fastmcp")
1819
df = local_session.create_dataframe({"city": ["SF"], "age": [10], "user_name": ["Alice"]})
1920
query = df.filter(
2021
(col("city") == tool_param("city_name", StringType))
@@ -56,7 +57,6 @@ def test_server_generation_with_parameterized_tools(local_session: Session):
5657
assert user_names_param['description'] == "User names"
5758

5859
def test_server_generation(local_session: Session):
59-
pytest.importorskip("fastmcp")
6060
create_table_with_rows(local_session, "t1", [1, 2, 3], description="table one")
6161
create_table_with_rows(local_session, "t2", [10, 20], description="table two")
6262

tests/core/mcp/test_binder.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ def test_bind_parameters_type_mismatch_raises(local_session: Session):
8080
required=True,
8181
has_default=False,
8282
allowed_values=None,
83-
default_value=None,
8483
)
8584
],
8685
)

0 commit comments

Comments
 (0)