Skip to content

Commit af68b49

Browse files
committed
feat: add filter validation and available fields methods to _BaseEntityClient; update test fixture to use pytest_asyncio
1 parent 9599310 commit af68b49

File tree

5 files changed

+47
-1
lines changed

5 files changed

+47
-1
lines changed

requirements-dev.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Include main requirements
2+
-r requirements.txt
3+
4+
# Additional development dependencies
5+
sphinx>=8.0.0
6+
sphinx-rtd-theme
7+
build
8+
twine
9+
setuptools>=45
10+
wheel
11+
setuptools_scm[toml]>=6.2
12+
13+
# Code quality tools
14+
black
15+
isort
16+
flake8
17+
mypy
18+
19+
# Documentation dependencies
20+
myst-parser

requirements-docs.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Documentation building requirements
2+
sphinx>=8.0.0
3+
sphinx-rtd-theme
4+
myst-parser
5+
6+
# Include main package dependencies for autodoc
7+
aiohttp>=3.8.0,<5.0.0
8+
dacite>=1.6.0,<2.0.0
9+
orjson>=3.0.0

requirements.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Main dependencies for veedb
2+
aiohttp>=3.8.0,<5.0.0
3+
dacite>=1.6.0,<2.0.0
4+
orjson>=3.0.0
5+
6+
# Development and testing dependencies
7+
pytest>=8.2,<9
8+
pytest-asyncio>=1.0.0

src/veedb/client.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,14 @@ async def query_paginated(
201201

202202
page_number += 1
203203

204+
async def validate_filters(self, filters: Union[List, str, None]) -> Dict[str, Any]:
205+
"""Validates filters against the schema for this specific endpoint."""
206+
return await self._client.validate_filters(self._endpoint_path, filters)
207+
208+
async def get_available_fields(self) -> List[str]:
209+
"""Gets all available filterable fields for this endpoint."""
210+
return await self._client.get_available_fields(self._endpoint_path)
211+
204212
class _VNClient(_BaseEntityClient[VN, VN]):
205213
def __init__(self, client: "VNDB"):
206214
super().__init__(client, "/vn", VN, VN)

tests/test_veedb.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import os
44
import sys
55
import pytest
6+
import pytest_asyncio
67

78
# This script assumes it's in a 'tests' directory, and the 'veedb' package is in a sibling 'src' directory.
89
# E.g., /project_root/src/veedb and /project_root/tests/test_veedb.py
@@ -25,7 +26,7 @@
2526
from veedb.apitypes.requests import UlistUpdatePayload
2627

2728

28-
@pytest.fixture
29+
@pytest_asyncio.fixture
2930
async def vndb():
3031
"""Provides an initialized VNDB client instance for tests."""
3132
client = VNDB()

0 commit comments

Comments
 (0)