A user reported a usability issue with Suzieq version 0.22.0 when using the Python API to retrieve path information. The API call was made with namespace provided as a string instead of a list, leading to an EmptyDataframeError. The error did not clearly indicate the cause, leading to confusion.
Changes Made
To address this issue, two significant changes were implemented:
Introduction of Argument Validation in basicobj.py:
A new method _validate_list_args was added to enforce that certain arguments, specifically namespace and hostname, are provided as lists. If these arguments are not lists, the method raises a TypeError with a clear and informative error message.
Modification in topology.py:
The initialization of self._namespaces was set to an empty list [].
In the get method, self._namespaces was changed to default to an empty list [] instead of using self.ctxt.namespace. This modification was implemented to address testing issues that arose following the introduction of _validate_list_args in basicobj.py.
Bug #925 Report Summary
A user reported a usability issue with Suzieq version 0.22.0 when using the Python API to retrieve path information. The API call was made with
namespace
provided as a string instead of a list, leading to anEmptyDataframeError
. The error did not clearly indicate the cause, leading to confusion.Changes Made
To address this issue, two significant changes were implemented:
Introduction of Argument Validation in
basicobj.py
:_validate_list_args
was added to enforce that certain arguments, specificallynamespace
andhostname
, are provided as lists. If these arguments are not lists, the method raises aTypeError
with a clear and informative error message.Modification in
topology.py
:self._namespaces
was set to an empty list[]
.get
method,self._namespaces
was changed to default to an empty list[]
instead of usingself.ctxt.namespace
. This modification was implemented to address testing issues that arose following the introduction of_validate_list_args
inbasicobj.py
.