Skip to content

Instantly share code, notes, and snippets.

@elijahbenizzy
Last active June 20, 2024 17:19
Show Gist options
  • Save elijahbenizzy/79fe6c49b5cfde930503995630ef9d64 to your computer and use it in GitHub Desktop.
Save elijahbenizzy/79fe6c49b5cfde930503995630ef9d64 to your computer and use it in GitHub Desktop.
from hamilton import driver
import definitions # contains node definitions, e.g. A, B, C from above
dr = driver.Builder().with_modules(definitions).build()
# request node named "C"; returns a dictionary of results
results = dr.execute(["C"], inputs={"external_input": 7})
# request node named "B"; returns a dictionary of results
results = dr.execute(["B"], inputs={"external_input": 7})
# request node named "B"; returns a dictionary of results
results = dr.execute(["A", "B", "C"], inputs={"external_input": 7})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment