chore(typing): Add type hints in qb builder classes

This commit is contained in:
Gavin D'souza 2022-01-10 13:44:23 +05:30
parent 04e79eb075
commit f6fba91fd2

View file

@ -1,6 +1,6 @@
from pypika import MySQLQuery, Order, PostgreSQLQuery, terms
from pypika.dialects import MySQLQueryBuilder, PostgreSQLQueryBuilder
from pypika.queries import Schema, Table
from pypika.queries import QueryBuilder, Schema, Table
from pypika.terms import Function
from frappe.query_builder.terms import ParameterizedValueWrapper
@ -23,13 +23,13 @@ class Base:
return Table(table_name, *args, **kwargs)
@classmethod
def into(cls, table, *args, **kwargs):
def into(cls, table, *args, **kwargs) -> QueryBuilder:
if isinstance(table, str):
table = cls.DocType(table)
return super().into(table, *args, **kwargs)
@classmethod
def update(cls, table, *args, **kwargs):
def update(cls, table, *args, **kwargs) -> QueryBuilder:
if isinstance(table, str):
table = cls.DocType(table)
return super().update(table, *args, **kwargs)