Skip to content

TST: Unused codepaths in computation/tests/test_eval #5041

@jtratner

Description

@jtratner

There are two places in test_eval where there are name errors (i.e., referring to items that aren't defined). Given that they don't raise errors, this means they aren't being used. I'm not sure whether this is because they're covered elsewhere or what, just need to make a decision.

From check_complex_cmp_ops

        elif _bool_and_frame(lhs, rhs):
            self.assertRaises(TypeError, _eval_single_bin, lhs_new, '&',
                              rhs_new, self.engine)
            self.assertRaises(TypeError, pd.eval, ex,
                              local_dict={'lhs': lhs, 'rhs': rhs},
                              engine=self.engine, parser=self.parser)

and also the second branch of check_operands in check_chained_cmp_ops

            if (np.isscalar(left) and np.isscalar(right) and
                    cmp_op in _bool_ops_syms):
                ex1 = 'lhs {0} mid {1} rhs'.format(cmp1, cmp2)
                ex2 = 'lhs {0} mid and mid {1} rhs'.format(cmp1, cmp2)
                ex3 = '(lhs {0} mid) & (mid {1} rhs)'.format(cmp1, cmp2)
                for ex in (ex1, ex2, ex3):
                    with assertRaises(NotImplementedError):
                        pd.eval(ex, engine=self.engine, parser=self.parser)
                return
  • test this function or remove it: _align_core_single_unary_op

Metadata

Metadata

Assignees

No one assigned

    Labels

    RefactorInternal refactoring of codeTestingpandas testing functions or related to the test suite

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions