Skip to content

Commit

Permalink
VER: Release 0.44.1
Browse files Browse the repository at this point in the history
See release notes.
  • Loading branch information
nmacholl authored Oct 29, 2024
2 parents a35f21f + 06c0991 commit e6ea548
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 19 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.44.1 - 2024-10-29

#### Enhancements
- Improved exception messages emitted by the `Live` client to always include contents of any `ErrorMsg` sent by the gateway

#### Bug fixes
- Fixed an issue where calling `Live.stop` would not close the connection within a reasonable time

## 0.44.0 - 2024-10-22

#### Enhancements
Expand Down
25 changes: 12 additions & 13 deletions databento/live/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,21 +195,20 @@ def connection_lost(self, exc: Exception | None) -> None:
"""
super().connection_lost(exc)
if not self.disconnected.done():
if exc is None:
logger.info("connection closed")
if self._error_msgs:
error_msg = ", ".join(self._error_msgs)
if len(self._error_msgs) > 1:
error_msg = f"The following errors occurred: {error_msg}"
self._error_msgs.clear()
self.disconnected.set_exception(
BentoError(error_msg),
)
else:
self.disconnected.set_result(None)
else:
if self._error_msgs:
error_msg = ", ".join(self._error_msgs)
if len(self._error_msgs) > 1:
error_msg = f"The following errors occurred: {error_msg}"
self._error_msgs.clear()

logger.error("gateway error: %s", exc)
self.disconnected.set_exception(BentoError(error_msg))
elif exc is not None:
logger.error("connection lost: %s", exc)
self.disconnected.set_exception(exc)
else:
logger.info("connection closed")
self.disconnected.set_result(None)

def eof_received(self) -> bool | None:
"""
Expand Down
3 changes: 1 addition & 2 deletions databento/live/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,7 @@ def stop(self) -> None:
return
if self._transport.can_write_eof():
self._transport.write_eof()
else:
self._transport.close()
self._transport.close()

def start(self) -> None:
"""
Expand Down
2 changes: 1 addition & 1 deletion databento/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.44.0"
__version__ = "0.44.1"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "databento"
version = "0.44.0"
version = "0.44.1"
description = "Official Python client library for Databento"
authors = [
"Databento <[email protected]>",
Expand Down
5 changes: 3 additions & 2 deletions tests/test_historical_bento.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,14 +365,15 @@ def test_to_parquet_overwrite(
dbnstore = DBNStore.from_bytes(data=stub_data)
parquet_path = tmp_path / "my_test.parquet"
dbnstore.to_parquet(path=parquet_path)
assert parquet_path.stat().st_size == 9888
parquet_size = parquet_path.stat().st_size

# Act
dbnstore.to_parquet(path=parquet_path)

# Assert
assert parquet_size > 0 # Should be about ~9000 bytes
assert parquet_path.exists()
assert parquet_path.stat().st_size == 9888
assert parquet_path.stat().st_size == parquet_size


def test_to_parquet_exclusive(
Expand Down

0 comments on commit e6ea548

Please sign in to comment.