eventsourcingdb 2.2.2__tar.gz → 2.2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/PKG-INFO +2 -2
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/README.md +1 -1
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/transport/v2/transport.py +7 -4
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/pyproject.toml +2 -2
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/.gitignore +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/LICENSE.md +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/__init__.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/bound.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/client.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/container.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/errors/__init__.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/errors/client_error.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/errors/connection_stalled_error.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/errors/custom_error.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/errors/db_api_error.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/errors/error_code.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/errors/hash_verification_failed_error.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/errors/incompatible_server_error.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/errors/internal_error.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/errors/is_outcome_unknown.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/errors/outcome_unknown_error.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/errors/server_error.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/errors/signature_verification_failed_error.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/errors/unsupported_hash_version_error.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/errors/validation_error.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/event/__init__.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/event/event.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/event/event_candidate.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/event/find_raw_data.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/http_client/__init__.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/http_client/get_get_headers.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/http_client/get_post_headers.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/http_client/http_client.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/http_client/request_state.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/http_client/response.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/http_client/stall_guard.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/is_valid_server_header.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/observe_events/__init__.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/observe_events/if_event_is_missing_during_observe.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/observe_events/observe_events_options.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/observe_events/observe_from_latest_event.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/pandas.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/parse_raw_message.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/py.typed +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/read_event_types/__init__.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/read_event_types/event_type.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/read_events/__init__.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/read_events/if_event_is_missing_during_read.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/read_events/order.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/read_events/read_events_options.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/read_events/read_from_latest_event.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/read_subjects/__init__.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/read_subjects/read_subjects_options.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/transport/__init__.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/transport/choose_transport.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/transport/error_of_answer.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/transport/guard_write.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/transport/statuses_without_v2_api.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/transport/stream_broke_off.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/transport/transport.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/transport/v1/__init__.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/transport/v1/code_of_error.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/transport/v1/is_event.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/transport/v1/is_event_type.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/transport/v1/is_heartbeat.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/transport/v1/is_stream_error.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/transport/v1/is_subject.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/transport/v1/parse_event_type.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/transport/v1/transport.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/transport/v2/__init__.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/transport/v2/envelopes.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/write_events/__init__.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/write_events/precondition_options.py +0 -0
- {eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/write_events/preconditions.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: eventsourcingdb
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.4
|
|
4
4
|
Summary: The official Python client SDK for EventSourcingDB.
|
|
5
5
|
Author-email: the native web GmbH <hello@thenativeweb.io>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -119,7 +119,7 @@ Servers without the v2 API report errors without a code. For them, the client as
|
|
|
119
119
|
|
|
120
120
|
EventSourcingDB never stores a write halfway: the events of a call to `write_events`, or the schema of a call to `register_event_schema`, are either stored completely or not at all. If one of these functions fails in a way that leaves open whether the server stored the write, it raises an `OutcomeUnknownError`, whose `cause` attribute holds the error that the write failed with. This happens, for example, if the server stalls or the connection breaks once the request has a connection, if the server answers with a status such as `500`, `502`, or `504`, if the answer does not come from EventSourcingDB, or if the server ends its answer before it is complete. Before you repeat such a write, find out whether it was stored, for example by reading the events of the subject, or repeat it with a precondition such as `IsSubjectOnEventId` that only holds if it was not stored.
|
|
121
121
|
|
|
122
|
-
The function raises the error itself, which tells that the write was certainly not stored, only if the client refused the write before sending it, such as with an `IncompatibleServerError`, if the client could not find out which API the server offers, which it asks with a ping before the write where needed (see [Talking to Servers With and Without the v2 API](#talking-to-servers-with-and-without-the-v2-api)), for example because the ping stalled, the server answered it with a status such as `500`, or the answer did not come from EventSourcingDB, if the request could not get a connection at all, such as when the name of the server cannot be resolved, connecting or TLS fails, or the request waits for a free connection for longer than the stall timeout, or if the server refused the write: with an error that it reports within its answer,
|
|
122
|
+
The function raises the error itself, which tells that the write was certainly not stored, only if the client refused the write before sending it, such as with an `IncompatibleServerError`, if the client could not find out which API the server offers, which it asks with a ping before the write where needed (see [Talking to Servers With and Without the v2 API](#talking-to-servers-with-and-without-the-v2-api)), for example because the ping stalled, the server answered it with a status such as `500`, or the answer did not come from EventSourcingDB, if the request could not get a connection at all, such as when the name of the server cannot be resolved, connecting or TLS fails, or the request waits for a free connection for longer than the stall timeout, or if the server refused the write: with an error that it reports within its answer, with one of the statuses `400`, `401`, `408`, `413`, `429`, and `503`, or, for servers without the v2 API, with any status `4xx`, `503`, or `507`.
|
|
123
123
|
|
|
124
124
|
Cancelling a write once it has a connection, for example with `asyncio.timeout` or by cancelling its task, leaves its outcome open as well. It is cancelled as usual nonetheless, so that `asyncio.timeout`, `asyncio.wait_for`, and task groups work as always: the `asyncio.CancelledError` is not wrapped, but marked, and carries a note that says so. To tell whether the outcome of a write is unknown, call `is_outcome_unknown` with the error. It returns `True` for an `OutcomeUnknownError`, for a marked `CancelledError`, and for an error caused by one of them, such as the `TimeoutError` of `asyncio.timeout`:
|
|
125
125
|
|
|
@@ -106,7 +106,7 @@ Servers without the v2 API report errors without a code. For them, the client as
|
|
|
106
106
|
|
|
107
107
|
EventSourcingDB never stores a write halfway: the events of a call to `write_events`, or the schema of a call to `register_event_schema`, are either stored completely or not at all. If one of these functions fails in a way that leaves open whether the server stored the write, it raises an `OutcomeUnknownError`, whose `cause` attribute holds the error that the write failed with. This happens, for example, if the server stalls or the connection breaks once the request has a connection, if the server answers with a status such as `500`, `502`, or `504`, if the answer does not come from EventSourcingDB, or if the server ends its answer before it is complete. Before you repeat such a write, find out whether it was stored, for example by reading the events of the subject, or repeat it with a precondition such as `IsSubjectOnEventId` that only holds if it was not stored.
|
|
108
108
|
|
|
109
|
-
The function raises the error itself, which tells that the write was certainly not stored, only if the client refused the write before sending it, such as with an `IncompatibleServerError`, if the client could not find out which API the server offers, which it asks with a ping before the write where needed (see [Talking to Servers With and Without the v2 API](#talking-to-servers-with-and-without-the-v2-api)), for example because the ping stalled, the server answered it with a status such as `500`, or the answer did not come from EventSourcingDB, if the request could not get a connection at all, such as when the name of the server cannot be resolved, connecting or TLS fails, or the request waits for a free connection for longer than the stall timeout, or if the server refused the write: with an error that it reports within its answer,
|
|
109
|
+
The function raises the error itself, which tells that the write was certainly not stored, only if the client refused the write before sending it, such as with an `IncompatibleServerError`, if the client could not find out which API the server offers, which it asks with a ping before the write where needed (see [Talking to Servers With and Without the v2 API](#talking-to-servers-with-and-without-the-v2-api)), for example because the ping stalled, the server answered it with a status such as `500`, or the answer did not come from EventSourcingDB, if the request could not get a connection at all, such as when the name of the server cannot be resolved, connecting or TLS fails, or the request waits for a free connection for longer than the stall timeout, or if the server refused the write: with an error that it reports within its answer, with one of the statuses `400`, `401`, `408`, `413`, `429`, and `503`, or, for servers without the v2 API, with any status `4xx`, `503`, or `507`.
|
|
110
110
|
|
|
111
111
|
Cancelling a write once it has a connection, for example with `asyncio.timeout` or by cancelling its task, leaves its outcome open as well. It is cancelled as usual nonetheless, so that `asyncio.timeout`, `asyncio.wait_for`, and task groups work as always: the `asyncio.CancelledError` is not wrapped, but marked, and carries a note that says so. To tell whether the outcome of a write is unknown, call `is_outcome_unknown` with the error. It returns `True` for an `OutcomeUnknownError`, for a marked `CancelledError`, and for an error caused by one of them, such as the `TimeoutError` of `asyncio.timeout`:
|
|
112
112
|
|
|
@@ -7,7 +7,6 @@ from typing import Any
|
|
|
7
7
|
from ...errors import (
|
|
8
8
|
CustomError,
|
|
9
9
|
DbApiError,
|
|
10
|
-
ErrorCode,
|
|
11
10
|
InternalError,
|
|
12
11
|
ServerError,
|
|
13
12
|
ValidationError,
|
|
@@ -64,11 +63,15 @@ REFUSING_STATUSES = {
|
|
|
64
63
|
def is_refusal(error: DbApiError) -> bool:
|
|
65
64
|
"""
|
|
66
65
|
Tells whether the server refused a write before it stored anything, as
|
|
67
|
-
the v2 API does with every error item
|
|
68
|
-
|
|
66
|
+
the v2 API does with every error item, and with the statuses above. This
|
|
67
|
+
includes store-failed, which the server reports only after its store has
|
|
68
|
+
failed, since it then refuses every later write until it is restarted. A
|
|
69
|
+
write during which storing fails gets an error without a code instead, a
|
|
70
|
+
status of 500 or a stream that ends before it is complete, so its outcome
|
|
71
|
+
is unknown.
|
|
69
72
|
"""
|
|
70
73
|
if error.status == HTTPStatus.OK:
|
|
71
|
-
return
|
|
74
|
+
return True
|
|
72
75
|
|
|
73
76
|
return error.status in REFUSING_STATUSES
|
|
74
77
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "eventsourcingdb"
|
|
3
|
-
version = "2.2.
|
|
3
|
+
version = "2.2.4"
|
|
4
4
|
description = "The official Python client SDK for EventSourcingDB."
|
|
5
5
|
authors = [{ name = "the native web GmbH", email = "hello@thenativeweb.io" }]
|
|
6
6
|
requires-python = ">=3.11, <3.15"
|
|
@@ -18,7 +18,7 @@ dev = [
|
|
|
18
18
|
"pytest-timeout==2.4.0",
|
|
19
19
|
"pytest-asyncio==1.4.0",
|
|
20
20
|
"pytest-cov==7.1.0",
|
|
21
|
-
"ruff==0.17.
|
|
21
|
+
"ruff==0.17.1",
|
|
22
22
|
"bandit==1.9.4",
|
|
23
23
|
"pyright==1.1.414",
|
|
24
24
|
"twine==7.0.0",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/errors/connection_stalled_error.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/errors/incompatible_server_error.py
RENAMED
|
File without changes
|
|
File without changes
|
{eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/errors/is_outcome_unknown.py
RENAMED
|
File without changes
|
{eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/errors/outcome_unknown_error.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/http_client/get_get_headers.py
RENAMED
|
File without changes
|
{eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/http_client/get_post_headers.py
RENAMED
|
File without changes
|
|
File without changes
|
{eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/http_client/request_state.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/read_event_types/__init__.py
RENAMED
|
File without changes
|
{eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/read_event_types/event_type.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/read_events/read_events_options.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/transport/choose_transport.py
RENAMED
|
File without changes
|
{eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/transport/error_of_answer.py
RENAMED
|
File without changes
|
|
File without changes
|
{eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/transport/statuses_without_v2_api.py
RENAMED
|
File without changes
|
{eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/transport/stream_broke_off.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/transport/v1/code_of_error.py
RENAMED
|
File without changes
|
|
File without changes
|
{eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/transport/v1/is_event_type.py
RENAMED
|
File without changes
|
{eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/transport/v1/is_heartbeat.py
RENAMED
|
File without changes
|
{eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/transport/v1/is_stream_error.py
RENAMED
|
File without changes
|
|
File without changes
|
{eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/transport/v1/parse_event_type.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/write_events/precondition_options.py
RENAMED
|
File without changes
|
{eventsourcingdb-2.2.2 → eventsourcingdb-2.2.4}/eventsourcingdb/write_events/preconditions.py
RENAMED
|
File without changes
|