|
1 | 1 | import datetime as dt |
2 | 2 | import logging |
| 3 | +import pathlib |
| 4 | +import warnings |
3 | 5 | from collections.abc import Callable |
4 | 6 | from os import PathLike |
5 | | -import pathlib |
6 | | -from typing import Generic |
7 | 7 | from typing import IO |
| 8 | +from typing import Generic |
8 | 9 | from typing import TypedDict |
9 | 10 | from typing import TypeVar |
10 | | -import warnings |
11 | 11 |
|
12 | 12 | import databento_dbn |
13 | 13 | import pandas as pd |
14 | 14 |
|
15 | 15 | from databento.common.error import BentoWarning |
16 | 16 |
|
| 17 | + |
17 | 18 | logger = logging.getLogger(__name__) |
18 | 19 |
|
19 | 20 | DBNRecord = ( |
@@ -188,14 +189,14 @@ def write(self, data: bytes) -> None: |
188 | 189 | except Exception as exc: |
189 | 190 | if self._exc_fn is None: |
190 | 191 | self._warn( |
191 | | - f"stream '{self.stream_name}' encountered an exception without an exception handler: {repr(exc)}", |
| 192 | + f"stream '{self.stream_name}' encountered an exception without an exception handler: {exc!r}", |
192 | 193 | ) |
193 | 194 | else: |
194 | 195 | try: |
195 | 196 | self._exc_fn(exc) |
196 | 197 | except Exception as inner_exc: |
197 | 198 | self._warn( |
198 | | - f"exception callback '{self.exc_callback_name}' encountered an exception: {repr(inner_exc)}", |
| 199 | + f"exception callback '{self.exc_callback_name}' encountered an exception: {inner_exc!r}", |
199 | 200 | ) |
200 | 201 | raise inner_exc from exc |
201 | 202 | raise exc |
@@ -258,14 +259,14 @@ def call(self, record: DBNRecord) -> None: |
258 | 259 | except Exception as exc: |
259 | 260 | if self._exc_fn is None: |
260 | 261 | self._warn( |
261 | | - f"callback '{self.callback_name}' encountered an exception without an exception callback: {repr(exc)}", |
| 262 | + f"callback '{self.callback_name}' encountered an exception without an exception callback: {exc!r}", |
262 | 263 | ) |
263 | 264 | else: |
264 | 265 | try: |
265 | 266 | self._exc_fn(exc) |
266 | 267 | except Exception as inner_exc: |
267 | 268 | self._warn( |
268 | | - f"exception callback '{self.exc_callback_name}' encountered an exception: {repr(inner_exc)}", |
| 269 | + f"exception callback '{self.exc_callback_name}' encountered an exception: {inner_exc!r}", |
269 | 270 | ) |
270 | 271 | raise inner_exc from exc |
271 | 272 | raise exc |
|
0 commit comments