Skip to content
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

Arithmetic with scalars doesn't work on slices #742

Closed
bjchambers opened this issue Sep 2, 2021 · 1 comment · Fixed by #743
Closed

Arithmetic with scalars doesn't work on slices #742

bjchambers opened this issue Sep 2, 2021 · 1 comment · Fixed by #743
Labels

Comments

@bjchambers
Copy link
Contributor

Describe the bug

As in #738 and #740, modulus_scalar and divide_scalar don't work on slices.

To Reproduce

    #[test]
    fn test_primitive_array_modulus_scalar_sliced() {
        let a = Int32Array::from(vec![Some(15), None, Some(9), Some(8), None]);
        let a = a.slice(1, 4);
        let a = as_primitive_array(&a);
        let actual = modulus_scalar(a, 3).unwrap();
        let expected = Int32Array::from(vec![None, Some(0), Some(2), None]);
        assert_eq!(actual, expected);
    }

Expected behavior
The test succeeds.

Actual behavior
The test doesn't succeed.

Additional context

@alamb
Copy link
Contributor

alamb commented Sep 9, 2021

Wow -- thank you for the train of fixes @bjchambers

@alamb alamb closed this as completed in #743 Sep 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants