-
Notifications
You must be signed in to change notification settings - Fork 4
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
Iterating over column raises IndexOutOfBoundsError
#47
Comments
lars-reimann
added a commit
that referenced
this issue
Mar 21, 2023
Closes #47. ### Summary of Changes * Add `__iter__` method to `Column` and `Row` to iterate over the values: * Iterating over a `Column` returns the values. * Iterating over a `Row` returns the column names, as specified in the [documenetation of `__iter__`](https://docs.python.org/3/reference/datamodel.html#object.__iter__). * Add `__len__` method to `Column` and `Row` to compute their length. * Change superclasses of exceptions as needed for [`__getitem__`](https://docs.python.org/3/reference/datamodel.html#object.__getitem__): * Change superclass of `IndexOutOfBoundsError` to `IndexError`. * Change superclass of `UnknownColumnNameError` to `KeyError`. --------- Co-authored-by: lars-reimann <[email protected]>
🎉 This issue has been resolved in version 0.3.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Running code like this
raises an
IndexOutOfBoundsError
becauseindex >= self._data.size
.If one instead writes
everything works as expected. But we don't want users to access the internal
_data
, so this is not a feasible workaround.Additional context (optional)
Rows are probably affected, too.
The text was updated successfully, but these errors were encountered: