Skip to content

Commit e0874af

Browse files
authored
Add doc strings to public API + add attempt errors + reorganize some files (#27)
Go through and add docstrings to almost the entirety of the public API, including examples and other niceties. This should be quite helpful to many people because VSCode renders Python docstrings when hovering over symbols. It could also be presumably used for producing Python docs, but I'm not going to bother with that. Add an `AttemptError` data class that unmarshals itself from `errors` on an insertion, although this will likely be only nominally useful since newly inserted rows never have any errors yet. Also, shift around some types around so they're in files named appropriately for what they are (e.g. `insert_opts.py`) rather than generic names (e.g. `model.py`). This also helps match the structure of the Ruby project so that it's easier to find things.
1 parent 165af01 commit e0874af

File tree

10 files changed

+905
-102
lines changed

10 files changed

+905
-102
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- Add doc strings for most of the public API. [PR #27](https://github.com/riverqueue/riverqueue-python/pull/27).
13+
- Add `riverqueue.AttemptError` data class to represent errors on a job row. [PR #27](https://github.com/riverqueue/riverqueue-python/pull/27).
14+
1015
## [0.5.0] - 2024-07-06
1116

1217
### Changed

src/riverqueue/__init__.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
# Reexport for more ergonomic use in calling code.
22
from .client import (
3+
MAX_ATTEMPTS_DEFAULT as MAX_ATTEMPTS_DEFAULT,
4+
PRIORITY_DEFAULT as PRIORITY_DEFAULT,
5+
QUEUE_DEFAULT as QUEUE_DEFAULT,
6+
UNIQUE_STATES_DEFAULT as UNIQUE_STATES_DEFAULT,
37
AsyncClient as AsyncClient,
48
JobArgs as JobArgs,
59
JobArgsWithInsertOpts as JobArgsWithInsertOpts,
610
Client as Client,
711
InsertManyParams as InsertManyParams,
12+
)
13+
from .client import (
814
InsertOpts as InsertOpts,
15+
InsertResult as InsertResult,
916
UniqueOpts as UniqueOpts,
1017
)
11-
from .model import (
12-
InsertResult as InsertResult,
18+
from .job import (
19+
AttemptError as AttemptError,
1320
Job as Job,
1421
JobState as JobState,
1522
)

0 commit comments

Comments
 (0)