ib; return `None` on empty bars frame resp so as to trigger raising `NoData` in the caller

distribute_dis
Tyler Goodlet 2024-01-03 18:16:48 -05:00
parent 2669db785c
commit b23d44e21a
1 changed files with 39 additions and 43 deletions

View File

@ -434,11 +434,8 @@ async def get_bars(
# current impl) to detect a cancel case.
# timeout=timeout,
)
# not enough bars signal, likely due to venue
# operational gaps.
# too_little: bool = False
if end_dt:
# usually either a request during a venue closure
# or into a large (weekend) closure gap.
if not bars:
# no data returned?
log.warning(
@ -447,14 +444,13 @@ async def get_bars(
f'end_dt: {end_dt}\n'
f'duration: {dt_duration}\n'
)
# NOTE: REQUIRED to pass back value..
result = None
return None
# raise NoData(
# f'{fqme}\n'
# f'end_dt:{end_dt}\n'
# )
else:
# not enough bars signal, likely due to venue
# operational gaps.
if end_dt:
dur_s: float = len(bars) * timeframe
bars_dur = Duration(seconds=dur_s)
dt_dur_s: float = dt_duration.in_seconds()