|
| 1 | +//------------------------------------------------------------------------------ |
| 2 | +// Copyright 2022-2023 H2O.ai |
| 3 | +// |
| 4 | +// Permission is hereby granted, free of charge, to any person obtaining a |
| 5 | +// copy of this software and associated documentation files (the "Software"), |
| 6 | +// to deal in the Software without restriction, including without limitation |
| 7 | +// the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 8 | +// and/or sell copies of the Software, and to permit persons to whom the |
| 9 | +// Software is furnished to do so, subject to the following conditions: |
| 10 | +// |
| 11 | +// The above copyright notice and this permission notice shall be included in |
| 12 | +// all copies or substantial portions of the Software. |
| 13 | +// |
| 14 | +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 15 | +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 16 | +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 17 | +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 18 | +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 19 | +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
| 20 | +// IN THE SOFTWARE. |
| 21 | +//------------------------------------------------------------------------------ |
| 22 | +<<<<<<<< HEAD:src/core/expr/fexpr_isna.cc |
| 23 | +#include "column/const.h" |
| 24 | +#include "column/isna.h" |
| 25 | +#include "expr/fexpr_column.h" |
| 26 | +#include "documentation.h" |
| 27 | +#include "expr/fexpr_func_unary.h" |
| 28 | +#include "expr/eval_context.h" |
| 29 | +#include "expr/workframe.h" |
| 30 | +#include "python/xargs.h" |
| 31 | +#include "stype.h" |
| 32 | +======== |
| 33 | +#ifndef dt_EXPR_FEXPR_ISNA_h |
| 34 | +#define dt_EXPR_FEXPR_ISNA_h |
| 35 | +#include "expr/fexpr_func.h" |
| 36 | +>>>>>>>> da5f26d3 (implemenation of isna fexpr):src/core/expr/fexpr_isna.h |
| 37 | +namespace dt { |
| 38 | +namespace expr { |
| 39 | + |
| 40 | + |
| 41 | +<<<<<<<< HEAD:src/core/expr/fexpr_isna.cc |
| 42 | +class FExpr_ISNA : public FExpr_FuncUnary { |
| 43 | + public: |
| 44 | + using FExpr_FuncUnary::FExpr_FuncUnary; |
| 45 | + |
| 46 | + |
| 47 | + std::string name() const override { |
| 48 | + return "isna"; |
| 49 | + } |
| 50 | + |
| 51 | + Column evaluate1(Column&& col) const override{ |
| 52 | + return make_isna_col(std::move(col)); |
| 53 | + } |
| 54 | +}; |
| 55 | + |
| 56 | + |
| 57 | +static py::oobj pyfn_isna(const py::XArgs &args) { |
| 58 | + auto isna = args[0].to_oobj(); |
| 59 | + return PyFExpr::make(new FExpr_ISNA(as_fexpr(isna))); |
| 60 | +} |
| 61 | + |
| 62 | +DECLARE_PYFN(&pyfn_isna) |
| 63 | + ->name("isna") |
| 64 | + ->docs(doc_dt_isna) |
| 65 | + ->arg_names({"cols"}) |
| 66 | + ->n_positional_args(1) |
| 67 | + ->n_required_args(1); |
| 68 | + |
| 69 | + |
| 70 | +}} // dt::expr |
| 71 | +======== |
| 72 | +class FExpr_ISNA : public FExpr_Func { |
| 73 | + private: |
| 74 | + ptrExpr arg_; |
| 75 | + |
| 76 | + public: |
| 77 | + FExpr_ISNA(ptrExpr&& arg); |
| 78 | + std::string repr() const override; |
| 79 | + Workframe evaluate_n(EvalContext& ctx) const override; |
| 80 | +}; |
| 81 | + |
| 82 | + |
| 83 | +}} // dt::expr |
| 84 | +#endif |
| 85 | +>>>>>>>> da5f26d3 (implemenation of isna fexpr):src/core/expr/fexpr_isna.h |
0 commit comments