-
Notifications
You must be signed in to change notification settings - Fork 22
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
Implements move_to #83
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @hbcarlos, thanks for adding move functionality! This looks good so far. Let me know if you have any questions about the codebase.
@Horusiath could you double check this?
src/y_array.rs
Outdated
SharedType::Integrated(v) => Ok(v.move_to(txn, source, target)), | ||
SharedType::Prelim(v) if source < v.len() as u32 && target < v.len() as u32 => { | ||
if source < 0 as u32 || target < 0 as u32 { | ||
Err::<PyIndexError, ()>(()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Err::<PyIndexError, ()>(()); | |
Err(PyIndexError::default_message()) |
Including a default message or specifically referencing whether source
or target
is out of bounds would be helpful.
Hey @Waidhoferj! Thank you so much for the help! I added a new commit with your suggestion and the implementation of |
Hi @hbcarlos, looks good! Could you add test cases covering these functions to |
I added some tests in my last commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests look great! Feel free to merge.
Thanks, @Waidhoferj! I don't have maintainer rights, I can not merge it. |
Hi @Waidhoferj.
I noticed the move feature had not yet been implemented here in the python bindings. I trying to implement it since we need it for JupyterLab.
Can you take a look at this? It is the first time I have looked at y-rs and y-py, and the first time I used rust, so I'm unsure if I'm implementing it correctly.
I'm keeping the PR as a draft because I want to implement
move_range_to
in the same PR, but first, I would like you to take a look at themove_to
function in case I'm doing something wrong.