ib; return `None` on empty bars frame resp so as to trigger raising `NoData` in the caller
parent
2669db785c
commit
b23d44e21a
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue