Skip to content

Commit

Permalink
Resolve ruff complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
lukehinds committed Nov 6, 2024
1 parent 3dd837a commit cd29dd6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions promptwright/dataset.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import json
import re


class Dataset:
"""
A class to represent a dataset consisting of samples, where each sample contains messages with specific roles.
Expand Down
1 change: 1 addition & 0 deletions promptwright/hf_hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from huggingface_hub import login
from huggingface_hub.utils import HfHubHTTPError, RepositoryNotFoundError


class HFUploader:
"""
HFUploader is a class for uploading datasets to the Hugging Face Hub.
Expand Down
3 changes: 1 addition & 2 deletions promptwright/topic_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ def validate_and_clean_response(response_text: str) -> str | list[str] | None:
topics = extract_list(response_text)
if topics:
return [topic.strip() for topic in topics if topic.strip()]

return None
return None # noqa: TRY300
except (json.JSONDecodeError, ValueError) as e:
print(f"Error parsing response: {str(e)}")
return None
Expand Down
8 changes: 5 additions & 3 deletions tests/test_engine.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import pytest
from unittest.mock import MagicMock, patch
import re
from promptwright.engine import DataEngine, EngineArguments, Dataset, TopicTree

import pytest

from promptwright.engine import DataEngine, Dataset, EngineArguments


@pytest.fixture
def engine_args():
Expand Down

0 comments on commit cd29dd6

Please sign in to comment.