Skip to content

Commit

Permalink
🐛 fix(parse): don't return errors for all dates
Browse files Browse the repository at this point in the history
  • Loading branch information
ljnsn committed Apr 28, 2024
1 parent 775001e commit 4046be0
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions dsws_client/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,18 +129,15 @@ def process_symbol_value( # noqa: PLR0913
value = symbol_value.parse()
if isinstance(symbol_value, DSString) and process_strings:
value = process_string_value(value) # type: ignore[arg-type]
if is_error:
for date in dates:
records[(symbol_value.symbol, date)][field] = value
elif isinstance(value, list):
if isinstance(value, list):
if len(value) != len(dates):
raise InvalidResponseError(
"Number of values does not match number of dates."
)
for date, xvalue in zip(dates, value):
records[(symbol_value.symbol, date)][field] = xvalue
else:
if len(dates) > 1:
if len(dates) > 1 and not is_error:
raise InvalidResponseError("More than one date found for single value.")
records[(symbol_value.symbol, dates[0])][field] = value

Expand Down

0 comments on commit 4046be0

Please sign in to comment.