Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Build DAG from functions directly

Aperta
#1,268 7 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python

Direzione di ricerca

Inizia dal percorso ad_hoc_utils esistente e dall’entry point Builder().with_modules() per capire come gli oggetti funzione vengono attualmente convertiti in DAG. L’issue non indica file né test; per considerare il lavoro completato è necessario scegliere e documentare un’API basata su funzioni supportata, coprirla con test e preservare il workflow esistente di caricamento dei moduli.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

core-work question

Summary

Add first-class way to build a DAG from function objects (in contrast to DIY/ hacky). The user API could be either:

  • Builder().with_functions()
  • or an intermediary my_module = module_from_functions(fns*) then passed to .with_modules()

Goals:

  • simplify codebase
  • foundation for better hierarchical / nested graph structures (i.e., subdags)

Current

At the core of Hamilton, users:

  1. write functions in a Python module ("dataflow code")
  2. load that module in the "driver code" to build a DAG
  3. execute the DAG via the Driver

Problem

  • It is currently possible to build Hamilton DAGs from functions, but we have no official "here's how you do it" that we guarantee we'll support.
    • ad_hoc_utils means exactly the opposite
  • In a notebook, there's no good reason to create a module from a notebook function before passing to Hamilton (except our how constraints)
  • Python module machinery is complex and adds indirection to the codebase (tests, notebook extension, LSP)

Benefits

  • greatly simply many unit tests
  • facilitate marimo integration

Hamilton 2.0 / Broader perspective

There's no well-defined structure or purpose to Hamilton top-level modules (e.g., nodes, graph_types, graph_utils, graph, ad_hoc_utils, base, hamilton.common, models). I propose a structure that matches the Hamilton lifecycle:

  • hamilton.parser: everything that deals with source code: how functions are written, if type annotations are present (not type matching), collecting functions from modules, converting a notebook cell string to a module, remove comments and docstring before hashing source code
  • hamilton.compiler: converting code to DAG: structuring the DAG from functions, applying function modifiers, validating types, etc.
  • remove ad_hoc_utils
Lingua principale
Jupyter Notebook
Stelle
2.6k
Fork
218
Merge medio
2g 13h
PR unite (30g)
18

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/hamilton

Tutte le issue di apache/hamilton

Issue simili

Altre issue su Compilers

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.