Open t3yamoto opened 4 years ago
_______________________________________________________________________________________________ test_sushiro _______________________________________________________________________________________________ def test_sushiro(): > df = SushiroAllergyParser().parse() tests/test_sushi_allergy_parser.py:76: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ src/sushi_allergy_parser/sushiro.py:50: in parse df = self._parse_table(filename, TABLE_LAYOUT) src/sushi_allergy_parser/sushiro.py:72: in _parse_table df_filterd = df.query('category != "分類"') .venv/lib/python3.8/site-packages/pandas/core/frame.py:3184: in query res = self.eval(expr, **kwargs) .venv/lib/python3.8/site-packages/pandas/core/frame.py:3300: in eval return _eval(expr, inplace=inplace, **kwargs) .venv/lib/python3.8/site-packages/pandas/core/computation/eval.py:322: in eval parsed_expr = Expr(expr, engine=engine, parser=parser, env=env, truediv=truediv) .venv/lib/python3.8/site-packages/pandas/core/computation/expr.py:827: in __init__ self.terms = self.parse() .venv/lib/python3.8/site-packages/pandas/core/computation/expr.py:844: in parse return self._visitor.visit(self.expr) .venv/lib/python3.8/site-packages/pandas/core/computation/expr.py:441: in visit return visitor(node, **kwargs) .venv/lib/python3.8/site-packages/pandas/core/computation/expr.py:447: in visit_Module return self.visit(expr, **kwargs) .venv/lib/python3.8/site-packages/pandas/core/computation/expr.py:441: in visit return visitor(node, **kwargs) .venv/lib/python3.8/site-packages/pandas/core/computation/expr.py:450: in visit_Expr return self.visit(node.value, **kwargs) .venv/lib/python3.8/site-packages/pandas/core/computation/expr.py:441: in visit return visitor(node, **kwargs) .venv/lib/python3.8/site-packages/pandas/core/computation/expr.py:744: in visit_Compare return self.visit(binop) .venv/lib/python3.8/site-packages/pandas/core/computation/expr.py:441: in visit return visitor(node, **kwargs) .venv/lib/python3.8/site-packages/pandas/core/computation/expr.py:563: in visit_BinOp op, op_class, left, right = self._maybe_transform_eq_ne(node) .venv/lib/python3.8/site-packages/pandas/core/computation/expr.py:484: in _maybe_transform_eq_ne right = self.visit(node.right, side="right") _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pandas.core.computation.expr.PandasExprVisitor object at 0x10e18c850>, node = <_ast.Constant object at 0x10e18cc10>, kwargs = {'side': 'right'}, method = 'visit_Constant' visitor = <bound method NodeVisitor.visit_Constant of <pandas.core.computation.expr.PandasExprVisitor object at 0x10e18c850>> def visit(self, node, **kwargs): if isinstance(node, str): clean = self.preparser(node) try: node = ast.fix_missing_locations(ast.parse(clean)) except SyntaxError as e: from keyword import iskeyword if any(iskeyword(x) for x in clean.split()): e.msg = "Python keyword not valid identifier" " in numexpr query" raise e method = "visit_" + node.__class__.__name__ visitor = getattr(self, method) > return visitor(node, **kwargs) E TypeError: visit_Constant() got an unexpected keyword argument 'side' .venv/lib/python3.8/site-packages/pandas/core/computation/expr.py:441: TypeError