pyronear / pyronear/pyro-annotator
Backend: fix make test warnings
Open
Beginner friendly
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 1
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 2
Description
tests/endpoints/test_source_apis.py::test_list_source_apis_deduplication
/app/app/api/api_v1/endpoints/source_apis.py:33: DeprecationWarning:
🚨 You probably want to use `session.exec()` instead of `session.execute()`.
This is the original SQLAlchemy `session.execute()` method that returns objects
of type `Row`, and that you have to call `scalars()` to get the model objects.
For example:
```Python
heroes = await session.execute(select(Hero)).scalars().all()
```
instead you could use `exec()`:
```Python
heroes = await session.exec(select(Hero)).all()
```
result = await session.execute(query)
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in app/api/api_v1/endpoints/source_apis.py at line 33 and review the session call identified by the warning. Run tests/endpoints/test_source_apis.py::test_list_source_apis_deduplication and confirm the test passes without the deprecation warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, sqlalchemy
- Domain
- backend, testing-qa
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100