Skip to content

added # pragma: no cover to relevant liness #212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions fastcrud/crud/fast_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ def _handle_or_filter(
value: dict
) -> list[ColumnElement]:
"""Handle OR conditions (e.g., age__or={'gt': 18, 'lt': 65})."""
if not isinstance(value, dict):
if not isinstance(value, dict): # pragma: no cover
raise ValueError("OR filter value must be a dictionary")

or_conditions = []
Expand All @@ -575,13 +575,13 @@ def _handle_not_filter(
value: dict
) -> list[ColumnElement[bool]]:
"""Handle NOT conditions (e.g., age__not={'eq': 20, 'between': (30, 40)})."""
if not isinstance(value, dict):
if not isinstance(value, dict): # pragma: no cover
raise ValueError("NOT filter value must be a dictionary")

not_conditions = []
for not_op, not_value in value.items():
sqlalchemy_filter = self._get_sqlalchemy_filter(not_op, not_value)
if sqlalchemy_filter is None:
if sqlalchemy_filter is None: # pragma: no cover
continue

condition = (
Expand All @@ -601,7 +601,7 @@ def _handle_standard_filter(
) -> list[ColumnElement[bool]]:
"""Handle standard comparison operators (e.g., age__gt=18)."""
sqlalchemy_filter = self._get_sqlalchemy_filter(operator, value)
if sqlalchemy_filter is None:
if sqlalchemy_filter is None: # pragma: no cover
return []

condition = (
Expand Down