-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix default type inference of CombinePerKey. (#16351)
More typehints propagation of CombinePerKey, MapTuple, FlatMapTuple get_type_hints returns an empty TypeHint object. Add with_default to initialize the typehints from the fn when the hints are generated. [default_type_hints() and in the map functions] In MapTuple and FlatMapTuple, the input type hint is still ignored. This is because IOTypeHints cannot distinguish *args from an ordinary argument. I feel there can be more complications even if this one is tracked. For CombinePerKey, also override infer_output_types() to perform an inference pass on the fn. This is more accurate than the default types. There is some redundancy with default_type_hints() Also fix strip_output_annotations (bug discovered while fixing the broken users from the above changes) It needs to inspect into the composites (Tuples etc), but wasn't doing so. For now we return Any if any inner hint of a composite is annotated. Expanded the comment. This shall be filed / synced as #16351 BUG=36682198 Co-authored-by: Andy Ye <andyye333@gmail.com>
- Loading branch information
1 parent
fbe6150
commit 66ffc0b
Showing
4 changed files
with
129 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters