Skip to content
  • Nsukami Patrick <ptrck at nskm dot xyz>'s avatar
    refactor(mypy): Add more type-hints to stmts module · 2873da817f33
    Nsukami Patrick authored
    Inside stmts module,
    somewhere we read, `self.groupby` attribute being added if not exists and used as a list:
    ```
    if not self.groupby:
        self.groupby = []
    ```
    
    Let's just define:
    - self.groupby self.orderby as instance attribute
    - self.groupby self.orderby as List of Any
    - remove the if not self.grouby check
    
    Do the same with the `self.orderby` attribute.
    
    Inside Select class:
    - update `remove` method signature. And fix the error:
      rql/stmts.py:940: error:
      Argument 1 to "remove_sort_term" of "Select" has incompatible type "BaseNode";
      expected "SortTerm"  [arg-type]
    
    - update undefine_variable method:
      remove useless check of var.variable attribute
    
    Inside undo.NodeOperation class:
    - simplify type hint for `node` parameter inside `NodeOperation.__init__` method
    2873da817f33