From 2bc8eda8c7f80b524f55ece46d9541677800c084 Mon Sep 17 00:00:00 2001 From: Yuan Chao Chou Date: Thu, 13 Oct 2022 06:34:27 -0700 Subject: [PATCH] Type-annotate dtypes.promote() Summary: `dtypes.promote()` is not typed. Fix it Differential Revision: D40330862 fbshipit-source-id: f1b02fcbd3efbf7e63e2b1bbc328241c226d9413 --- torcharrow/dtypes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torcharrow/dtypes.py b/torcharrow/dtypes.py index e49abcbb0..8ddcbb96b 100644 --- a/torcharrow/dtypes.py +++ b/torcharrow/dtypes.py @@ -364,7 +364,7 @@ def infer_dype_from_callable_hint( ] -def promote(l, r): +def promote(l: DType, r: DType) -> ty.Optional[DType]: assert is_boolean_or_numerical(l) and is_boolean_or_numerical(r) lt = l.typecode