Skip to content

Commit cc8343d

Browse files
committed
Added Parallelizable Subclass info to docs
1 parent 83f0352 commit cc8343d

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

docs/concepts/parallel-task.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,3 +266,10 @@ to set what should be determined to be collected at DAG construction time:
266266
267267
# Then in the driver building pass in the configuration:
268268
.with_config(_config)
269+
270+
Parallelizable Subclassing
271+
=============
272+
273+
When annotating a function with `Parallelizable`, it is not possible to specify in the annotation what the type returned by the function will actually be, and these are not identified by a linter or other tools as static type checking. Especially for functions that can be used with or without Hamilton, this can be a problem.
274+
275+
To solve this problem, it is possible to create subclasses of the `Parallelizable` classes. The ["Parallelizable Subclass" example](https://github.com/dagworks-inc/hamilton/blob/main/examples/parallelism/parallelizable_subclass) showcases how to do that.

0 commit comments

Comments
 (0)