Skip to content

Resolve "Unhashable type list error while calling the read_series method in ForecastSolarConnection"

Summary

This merge request addresses a TypeError related to unhashable types when using NodeForecastSolar objects within sets or other hash-based collections. The error was resolved by excluding certain list-based fields from being included in the __hash__ method.

Explain your context

I identified that the TypeError occurred because the NodeForecastSolar class had attributes that could be lists, which are unhashable and therefore caused issues when the objects were used in sets (such as in the _validate_nodes method of the ForecastSolarConnection class). To fix this, I modified the attrs definition of the NodeForecastSolar class to set eq=False for these list-based fields, thereby excluding them from the auto-generated __hash__ method. This allows the NodeForecastSolar objects to be used in sets without raising the TypeError.

Please list breaking changes, new features or bugfixes

  • Breaking changes:

  • New features:

  • Bugfixes:

    • Fixed TypeError caused by unhashable list-based attributes in NodeForecastSolar class.

Closes #307 (closed)

Edited by Md Shadman Hasan

Merge request reports