Allow decorator use for functions defined in other modules
Los mantenedores suelen responder en 7 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- python
- Área
- data-engineering
Línea de trabajo
Comienza con la reproducción en my_module/init.py, base.py, base_extended.py y run.py, centrándote en hamilton.function_modifiers.parameterize y en cómo driver.Builder().with_modules() descubre las funciones. Reproduce los errores de definición duplicada y de nodo faltante; después, rastrea si decorar base.a cambia la función independiente. Se considera terminado cuando las funciones importadas decoradas funcionan sin duplicar ni eliminar el nodo original del grafo.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Is your feature request related to a problem? Please describe.
The following code throws errors:
Under: my_module/
__init__.py
from .base import a, z
from .base_extended import b_p, d, e
base.py
def a(input: int) -> int:
return input * 2
def z(input: int) -> int:
return input * 3
base_extended.py
from hamilton.function_modifiers import parameterize, value
from my_module import base
b_p = parameterize(
b={"input":value(1)},
c={"input":value(2)}
)(base.a)
def d(b: int, c: int) -> int:
return b + c
Then in my run.py outside my_module.
from hamilton import driver
import my_module
dr = driver.Builder().with_modules(my_module).build()
dr.display_all_functions("base_extended.png")
print(dr.execute(['b', 'c']))
Throws two possible things (if you allow module overrides one error goes away):
bis redefined twice.ais missing from the graph.
Describe the likely problem
- I think we're modifying the underlying function in the
parameterizedecorator which results inabeing lost. - Because of (2) we have
aeffectively as a function twice. Once via the parameterize decorator, once via module import. This then means that we're definingbandctwice.
Describe the solution you'd like
- we should be able to import functions and use them in a decorator - without impacting the use of that function in hamilton as a standalone by itself thing.
- with (1) resolved I think things should then just work.
Describe alternatives you've considered
N/A
Additional context
Comes from a problem a user ran into in slack.
- Lenguaje dominante
- Jupyter Notebook
- Estrellas
- 2.6k
- Forks
- 228
- Merge medio
- 8 d 9 min
- PR fusionados (30 d)
- 27
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/hamilton
-
FunctionInputOutputTypeChecker rejects correct values for fixed-length tuple annotations (tuple[int, str])Posiblemente ocupada @tarang-tp la tomó hace 11 días. Abiertobug core-work
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 7 días
-
Engine crashes when client sends nan or inf float to UIQuizá libre de nuevo @Exudev la tomó hace 253 días y no hay ningún pull request abierto. Abiertobug SDK
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
apache/hamilton#1458 · 5 comentarios ·
Los mantenedores suelen responder en 7 días
-
More detailed type annotations in graph visualizationsQuizá libre de nuevo @Nishant-Manocha la tomó hace 388 días y no hay ningún pull request abierto. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
apache/hamilton#1383 · 4 comentarios ·
Los mantenedores suelen responder en 7 días
-
Documentation: add explainer for FastAPIQuizá libre de nuevo @Aditya-Deshwal23 la tomó hace 207 días y no hay ningún pull request abierto. Abiertodocumentation
Dificultad 2/5 1-2 días Aptitud para principiantes 65/100
apache/hamilton#1304 · 5 comentarios ·
Los mantenedores suelen responder en 7 días
-
Link back to github from reference API docsPosiblemente ocupada @naikvaib la tomó hace 45 días. Abiertodocumentation good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
apache/hamilton#572 · 3 comentarios ·
Los mantenedores suelen responder en 7 días
Todos los issues de apache/hamilton
Issues similares
-
p values scientific notationAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
garner-code/PsyR#65 ·
-
qa_bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
NVIDIA-NeMo/Gym#5644 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
bug libcudf
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
SCIInstitute/SCIRun#2901 ·
Los mantenedores suelen responder en 2 días