Skip to content

Commit ad0c4c7

Browse files
blaiszikclaude
andcommitted
Fix flake8 linting errors
- Remove unused imports (sys, rprint, Optional, pandas, numpy) - Fix unused exception variable - Remove f-string without placeholders - Split long line in MCP server description - Add noqa comment for intentional re-export Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 1d13bf4 commit ad0c4c7

4 files changed

Lines changed: 6 additions & 11 deletions

File tree

foundry/__main__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,13 @@
1010
"""
1111

1212
import json
13-
import sys
1413
from typing import Optional
1514

1615
import typer
1716
from rich.console import Console
1817
from rich.table import Table
1918
from rich.panel import Panel
2019
from rich.progress import Progress, SpinnerColumn, TextColumn
21-
from rich import print as rprint
2220

2321
app = typer.Typer(
2422
name="foundry",
@@ -189,7 +187,7 @@ def schema(
189187
f = get_foundry()
190188
try:
191189
dataset = f.get_dataset(doi)
192-
except Exception as e:
190+
except Exception:
193191
console.print(f"[red]Error: Could not find dataset '{doi}'[/red]")
194192
raise typer.Exit(1)
195193

@@ -340,7 +338,7 @@ def push_to_hf(
340338
console.print(f"[dim]{e}[/dim]")
341339
raise typer.Exit(1)
342340

343-
progress.update(task, description=f"Exporting to HuggingFace Hub...")
341+
progress.update(task, description="Exporting to HuggingFace Hub...")
344342
try:
345343
url = push_to_hub(dataset, repo, token=token, private=private)
346344
except Exception as e:

foundry/integrations/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"""
1313

1414
try:
15-
from .huggingface import push_to_hub
15+
from .huggingface import push_to_hub # noqa: F401
1616
__all__ = ["push_to_hub"]
1717
except ImportError:
1818
# huggingface extras not installed

foundry/integrations/huggingface.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,6 @@ def push_to_hub(
112112

113113
def _combine_inputs_targets(inputs: Dict, targets: Dict) -> Dict[str, Any]:
114114
"""Combine input and target dictionaries into a single flat dict."""
115-
import pandas as pd
116-
import numpy as np
117-
118115
combined = {}
119116

120117
for key, value in inputs.items():
@@ -131,7 +128,6 @@ def _combine_inputs_targets(inputs: Dict, targets: Dict) -> Dict[str, Any]:
131128
def _flatten_data(data: Any) -> Dict[str, Any]:
132129
"""Flatten nested data structure to a dict suitable for HF Dataset."""
133130
import pandas as pd
134-
import numpy as np
135131

136132
if isinstance(data, pd.DataFrame):
137133
return {col: data[col].tolist() for col in data.columns}

foundry/mcp/server.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import json
1414
import logging
15-
from typing import Any, Dict, List, Optional
15+
from typing import Any, Dict, List
1616

1717
logger = logging.getLogger(__name__)
1818

@@ -178,7 +178,8 @@ def _serialize_data(data: Any) -> Any:
178178
},
179179
{
180180
"name": "get_dataset_schema",
181-
"description": "Get the schema of a dataset - what fields it contains, their descriptions, and units. Use this to understand the data structure before loading.",
181+
"description": "Get the schema of a dataset - what fields it contains, their descriptions, "
182+
"and units. Use this to understand the data structure before loading.",
182183
"inputSchema": {
183184
"type": "object",
184185
"properties": {

0 commit comments

Comments
 (0)