Skip to content

Commit dd42606

Browse files
committed
fix typo issues
1 parent 75de95c commit dd42606

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

eventsourcingdb/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ async def __aenter__(self) -> "Client":
3434

3535
async def __aexit__(
3636
self,
37-
exc_type: type[BaseException] | None = None,
37+
exc_type: BaseException | None = None,
3838
exc_val: BaseException | None = None,
3939
exc_tb: TracebackType | None = None,
4040
) -> None:

eventsourcingdb/container.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,12 @@ def _fetch_mapped_port(self) -> None:
100100
def _get_container_info(self) -> dict | None:
101101
if self._container is None:
102102
return None
103-
return self._docker_client.api.inspect_container(self._container.id)
103+
try:
104+
if self._container.id is None:
105+
return None
106+
return self._docker_client.api.inspect_container(self._container.id)
107+
except (errors.NotFound, errors.APIError):
108+
return None
104109

105110
def get_api_token(self) -> str:
106111
return self._api_token

eventsourcingdb/read_event_types/event_type.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ def parse(unknown_object: dict) -> "EventType":
3232
schema=schema,
3333
)
3434

35-
def __hash__(self) -> str:
35+
def __hash__(self) -> int: # Changed from str to int
3636
# Convert dictionary schema to a hashable form (tuple of items)
3737
if isinstance(self.schema, dict):
3838
# Sort items to ensure consistent hashing
3939
schema_items = tuple(sorted((k, str(v)) for k, v in self.schema.items()))
40-
return hash((self.event_type, self.is_phantom, schema_items))
41-
return hash((self.event_type, self.is_phantom, self.schema))
40+
return hash((self.event_type, self.is_phantom, schema_items)) # Remove str() conversion
41+
return hash((self.event_type, self.is_phantom, self.schema)) # Remove str() conversion

0 commit comments

Comments
 (0)