I discovered that method to_df from the CloudForCustomers connector class doesn't handle the situation where the method returns an empty data frame. If there are no results, a very generic error will be raised- KeyError.
Moreover, if a field argument is provided c4c.to_df(fields=['a', 'b']) and field a doesn't exist in c4c there will be also KeyError.
As a result of this, we have the same generic error ( KeyError ) in two different cases.
Raising KeyError where there are empty results, I consider as a bug.
As a fix please consider implementing two different kinds of errors with proper messages.
I discovered that method to_df from the CloudForCustomers connector class doesn't handle the situation where the method returns an empty data frame. If there are no results, a very generic error will be raised- KeyError.
Moreover, if a field argument is provided
c4c.to_df(fields=['a', 'b'])and fieldadoesn't exist in c4c there will be also KeyError.As a result of this, we have the same generic error ( KeyError ) in two different cases.
Raising KeyError where there are empty results, I consider as a bug.
As a fix please consider implementing two different kinds of errors with proper messages.