Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

models: Use more accurate type annotations for as_sql.

Zixuan James Li1c4741cec35a
diff --git a/zerver/models.py b/zerver/models.py
index ac6207a7c14..b8b6a9a0d3e 100644
--- a/zerver/models.py
+++ b/zerver/models.py
@@ -136,7 +136,7 @@ class AndZero(models.Lookup):
def as_sql(
self, compiler: SQLCompiler, connection: BaseDatabaseWrapper
- ) -> Tuple[str, List[object]]: # nocoverage # currently only used in migrations
+ ) -> Tuple[str, List[Union[str, int]]]: # nocoverage # currently only used in migrations
lhs, lhs_params = self.process_lhs(compiler, connection)
rhs, rhs_params = self.process_rhs(compiler, connection)
return f"{lhs} & {rhs} = 0", lhs_params + rhs_params
@@ -148,7 +148,7 @@ class AndNonZero(models.Lookup):
def as_sql(
self, compiler: SQLCompiler, connection: BaseDatabaseWrapper
- ) -> Tuple[str, List[object]]: # nocoverage # currently only used in migrations
+ ) -> Tuple[str, List[Union[str, int]]]: # nocoverage # currently only used in migrations
lhs, lhs_params = self.process_lhs(compiler, connection)
rhs, rhs_params = self.process_rhs(compiler, connection)
return f"{lhs} & {rhs} != 0", lhs_params + rhs_params