Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: legacy node data without best_block property #304

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

alexruzenhack
Copy link
Contributor

@alexruzenhack alexruzenhack commented Jan 18, 2024

Acceptance Criteria

  • Fix by making the best_block property Optional.

Log of the error:

[ERROR] MissingValueError: missing value for field "nodes.best_block"
Traceback (most recent call last):
  File "/var/task/handlers/node_data_aggregator.py", line 10, in handle
    result_aggregate = aggregate_node_data.aggregate()
  File "/var/task/usecases/aggregate_node_data.py", line 39, in aggregate
    old_network = self.node_gateway.get_network()
  File "/var/task/gateways/node_gateway.py", line 111, in get_network
    return Network.from_dict(value)
  File "/var/task/domain/network/network.py", line 214, in from_dict
    return from_dict(
  File "/opt/python/dacite/core.py", line 63, in from_dict
    value = _build_value(type_=field.type, data=transformed_value, config=config)
  File "/opt/python/dacite/core.py", line 90, in _build_value
    return _build_value_for_collection(collection=type_, data=data, config=config)
  File "/opt/python/dacite/core.py", line 140, in _build_value_for_collection
    return data_type(_build_value(type_=item_type, data=item, config=config) for item in data)
  File "/opt/python/dacite/core.py", line 140, in <genexpr>
    return data_type(_build_value(type_=item_type, data=item, config=config) for item in data)
  File "/opt/python/dacite/core.py", line 92, in _build_value
    return from_dict(data_class=type_, data=data, config=config)
  File "/opt/python/dacite/core.py", line 75, in from_dict
    raise MissingValueError(field.name)

Security Checklist

  • Make sure you do not include new dependencies in the project unless strictly necessary and do not include dev-dependencies as production ones. More dependencies increase the possibility of one of them being hijacked and affecting us.

@alexruzenhack alexruzenhack requested a review from r4mmer as a code owner January 18, 2024 00:42
@alexruzenhack alexruzenhack requested review from jansegre and pedroferreira1 and removed request for r4mmer January 18, 2024 00:42
@alexruzenhack alexruzenhack self-assigned this Jan 18, 2024
- Fix by making the best_block property Optional.
@alexruzenhack alexruzenhack merged commit 0e83b2e into dev Jan 18, 2024
4 checks passed
@alexruzenhack alexruzenhack deleted the fix/aggregate-network branch January 18, 2024 15:58
This was referenced Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants