Skip to content

Commit 92fd53b

Browse files
FIX: T673 Fix printing of GatewayErrorMsg in ticktxt.c
1 parent e9bd9c2 commit 92fd53b

File tree

5 files changed

+11
-0
lines changed

5 files changed

+11
-0
lines changed

databento/common/bento.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def _get_index_column(self) -> str:
5252
Schema.OHLCV_1M,
5353
Schema.OHLCV_1H,
5454
Schema.OHLCV_1D,
55+
Schema.GATEWAY_ERROR,
5556
)
5657
else "ts_recv"
5758
)

databento/common/data.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ def get_deriv_ba_types(level: int) -> List[Tuple[str, Union[type, str]]]:
172172
("tick_rule", np.uint8),
173173
("dummy", "S1"), # 1 byte chararray
174174
],
175+
Schema.GATEWAY_ERROR: RECORD_HEADER
176+
+ [
177+
("error", "S64"),
178+
],
175179
}
176180

177181

databento/common/enums.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class Schema(Enum):
5050
DEFINITION = "definition"
5151
STATISTICS = "statistics"
5252
STATUS = "status"
53+
GATEWAY_ERROR = "gateway_error"
5354

5455

5556
@unique

databento/common/parsing.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,8 @@ def schema_to_int(schema: Schema) -> int:
340340
return 10
341341
elif schema == Schema.STATUS:
342342
return 11
343+
elif schema == Schema.GATEWAY_ERROR:
344+
return 12
343345
else:
344346
raise NotImplementedError(
345347
f"The enum value '{schema.value}' "
@@ -372,6 +374,8 @@ def int_to_schema(value: int) -> Schema:
372374
return Schema.STATISTICS
373375
elif value == 11:
374376
return Schema.STATUS
377+
elif value == 12:
378+
return Schema.GATEWAY_ERROR
375379
else:
376380
raise NotImplementedError(
377381
f"The int value '{value}' " f"cannot be represented with the enum",

tests/test_historical_bento.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ def test_replay_with_stub_data_record_passes_to_callback(self) -> None:
225225
Schema.STATUS,
226226
Schema.STATISTICS,
227227
Schema.DEFINITION,
228+
Schema.GATEWAY_ERROR,
228229
)
229230
],
230231
)

0 commit comments

Comments
 (0)