Skip to content

Commit c57df4e

Browse files
author
Zach Banks
committed
DOC: Clarify flags field meaning in multidocs
1 parent b2e36b5 commit c57df4e

File tree

4 files changed

+19
-18
lines changed

4 files changed

+19
-18
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## TBD
4+
- Updated `Flags` enum
5+
36
## 0.6.0 - 2022-12-02
47
- Added `metadata.get_dataset_condition` method to `Historical` client
58
- Upgraded `dbz-python` to `0.2.0`

databento/common/enums.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,9 @@ class SymbologyResolution(Enum):
134134
class Flags(Enum):
135135
"""Represents record flags."""
136136

137-
F_LAST = 1 << 7 # 128 Last msg in packet (flags < 0)
138-
F_HALT = 1 << 6 # 64 Exchange-independent HALT signal
139-
F_RESET = 1 << 5 # 32 Drop book, reset symbol for this exchange
140-
F_DUPID = 1 << 4 # 16 This OrderID has valid fresh duplicate (Iceberg, etc)
141-
F_MBP = 1 << 3 # 8 This is SIP/MBP ADD message, single per price level
142-
F_RESERVED2 = 1 << 2 # 4 Reserved for future use
143-
F_RESERVED1 = 1 << 1 # 2 Reserved for future use
144-
F_RESERVED0 = 1 # Reserved for future use
137+
# Last message in the packet from the venue for a given `product_id`
138+
F_LAST = 1 << 7
139+
# Aggregated price level message, not an individual order
140+
F_MBP = 1 << 4
141+
# The `ts_recv` value is inaccurate (clock issues or reordering)
142+
F_BAD_TS_RECV = 1 << 3

databento/common/parsing.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -283,14 +283,11 @@ def parse_flags(value: int, apply_bitmask: bool = False) -> List[str]:
283283
flag represented by a single integer.
284284
285285
Possible values include:
286-
- F_LAST: Last msg in packet (flags < 0).
287-
- F_HALT: Exchange-independent HALT signal.
288-
- F_RESET: Drop book, reset symbol for this exchange.
289-
- F_DUPID: This OrderID has valid fresh duplicate (Iceberg, etc).
290-
- F_MBP: This is SIP/MBP ADD message, single per price level.
291-
- F_RESERVED2: Reserved for future use (no current meaning).
292-
- F_RESERVED1: Reserved for future use (no current meaning).
293-
- F_RESERVED0: Reserved for future use (no current meaning).
286+
- F_LAST: Last message in the packet from the venue for a given `product_id`
287+
- F_MBP: Aggregated price level message, not an individual order
288+
- F_BAD_TS_RECV: The `ts_recv` value is inaccurate (clock issues or reordering)
289+
290+
Other bits are reserved and have no current meaning.
294291
295292
Parameters
296293
----------

tests/test_common_parsing.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,12 @@ def test_maybe_datetime_to_string_give_valid_values_returns_expected_results(
229229
"value, expected",
230230
[
231231
[Flags.F_LAST.value, ["F_LAST"]],
232-
[Flags.F_DUPID.value | Flags.F_LAST.value, ["F_LAST", "F_DUPID"]],
232+
[
233+
Flags.F_BAD_TS_RECV.value | Flags.F_LAST.value,
234+
["F_LAST", "F_BAD_TS_RECV"],
235+
],
233236
[128, ["F_LAST"]],
234-
[129, ["F_LAST", "F_RESERVED0"]],
237+
[136, ["F_LAST", "F_BAD_TS_RECV"]],
235238
],
236239
)
237240
def test_parse_flags_given_valid_values_returns_expected_results(

0 commit comments

Comments
 (0)