-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
from __future__ import annotations breaks Parallelizable<>Collect #1111
Labels
triage
label for issues that need to be triaged.
Comments
jernejfrank
changed the title
Bug Report
from __future__ import annotations breaks Parallelizable<>Collect
Aug 30, 2024
Might be worth filling out the "Library & System Information" section, in particular - your python version. The important part, to me, is ensuring there's a unit test that covers this behavior. |
Sorry, added that in there. |
Simpler repro, also python3.10: from __future__ import annotations
from hamilton.htypes import Parallelizable, Collect
def foo() -> Parallelizable[int]:
yield 1
yield 2
yield 3
def bar(foo: int) -> int:
return foo + 1
def baz(bar: Collect[int]) -> int:
return sum(bar)
if __name__ == "__main__":
from hamilton import driver
from hamilton.execution import executors
import __main__
dr_serial = (
driver.Builder()
.with_modules(__main__)
.enable_dynamic_execution(allow_experimental_mode=True)
.with_local_executor(executors.SynchronousLocalTaskExecutor())
.build()
)
outputs = [
"baz"
]
dr_serial.display_all_functions("./future_annotations.png")
result = dr_serial.execute(final_vars=outputs)[outputs[0]]
print(result) will dig in soon |
Solved this in #1113! |
7 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Me again,
I am parallelizing some stuff and ran some issues with from future import annotations. There was already an issue about this back in 2023: #91 that got fixed, but I found that it still breaks the Parallelizable<>Collect block.
Current behavior
Parallelizable[Dict[str,Any]]
outputs the whole list instead of a single entry.Stack Traces
Steps to replicate behavior
Library & System Information
Expected behavior
Can used
from __future__ import annotations
andParallelizable<>Collect
in same module.Additional context
Also a nice to have, but really low priority thing would be to have something like
The text was updated successfully, but these errors were encountered: