Skip to content
Merged
Show file tree
Hide file tree
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: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,11 @@ repos:
- '-o'
- 'requirements.txt'
- '--no-hashes'

- repo: local
hooks:
- id: ty
language: python
name: ty
pass_filenames: false
entry: uv run ty check sqlalchemy_crud_plus
9 changes: 5 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ repository = "https://github.com/fastapi-practices/sqlalchemy-crud-plus"

[dependency-groups]
dev = [
"pytest>=8.1.1",
"aiosqlite>=0.20.0",
"pytest-asyncio>=0.23.6",
"pytest>=8.4.0",
"aiosqlite>=0.21.0",
"pytest-asyncio>=1.2.0",
"ty>=0.0.1a23",
]
lint = [
"pre-commit>=3.5.0",
"pre-commit>=4.3.0",
]

[tool.uv]
Expand Down
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ platformdirs==4.5.0
pluggy==1.6.0
# via pytest
pre-commit==4.3.0
pydantic==2.12.0
pydantic==2.12.2
# via sqlalchemy-crud-plus
pydantic-core==2.41.1
pydantic-core==2.41.4
# via pydantic
pygments==2.19.2
# via pytest
Expand All @@ -46,6 +46,7 @@ sqlalchemy==2.0.44
# via sqlalchemy-crud-plus
tomli==2.3.0 ; python_full_version < '3.11'
# via pytest
ty==0.0.1a23
typing-extensions==4.15.0
# via
# aiosqlite
Expand Down
3 changes: 2 additions & 1 deletion sqlalchemy_crud_plus/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,8 @@ def build_load_strategies(model: type[Model], load_strategies: LoadStrategies |
try:
attr = getattr(model, column)
strategy_func = strategies_map.get(strategy_name)
options.append(strategy_func(attr))
if strategy_func:
options.append(strategy_func(attr))
except AttributeError:
raise ModelColumnError(f'Invalid relationship column: {column}')

Expand Down
Loading