Skip to content
This repository has been archived by the owner on Jul 3, 2023. It is now read-only.

@does + default kwargs don't work #185

Closed
elijahbenizzy opened this issue Aug 22, 2022 · 1 comment
Closed

@does + default kwargs don't work #185

elijahbenizzy opened this issue Aug 22, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@elijahbenizzy
Copy link
Collaborator

Short description explaining the high-level reason for the new issue.

Current behavior

It breaks, dependencies marked as optional are not carried over.

Stack Traces

(If applicable)

Screenshots

(If applicable)

Steps to replicate behavior

from hamilton import driver
from hamilton.function_modifiers import does
from hamilton.ad_hoc_utils import create_temporary_module


def _identity(**kwargs) -> int:
    return 1

@does(_identity)
def foo(bar: int=1) -> int:
    pass

h_dr = driver.Driver({}, create_temporary_module(foo))
h_dr.raw_execute(['foo'])
python ./demo-hamilton-bug.py
Traceback (most recent call last):
  File "/Users/elijahbenizzy/dev/hamilton-os/sf_nlp/etls/./demo-hamilton-bug.py", line 14, in <module>
    h_dr.raw_execute(['foo'])
  File "/Users/elijahbenizzy/dev/hamilton-os/hamilton/hamilton/driver.py", line 147, in raw_execute
    self.validate_inputs(user_nodes, inputs)  # TODO -- validate within the function graph itself
  File "/Users/elijahbenizzy/dev/hamilton-os/hamilton/hamilton/driver.py", line 102, in validate_inputs
    raise ValueError(error_str)
ValueError: 1 errors encountered:
  Error: Required input bar not provided for nodes: ['foo'].

Library & System Information

E.g. python version, hamilton library version, linux, etc.

Expected behavior

This should work

Additional context

Add any other context about the problem here.

@elijahbenizzy elijahbenizzy added the triage label for issues that need to be triaged. label Aug 22, 2022
@skrawcz skrawcz added the bug Something isn't working label Aug 22, 2022
@skrawcz skrawcz removed the triage label for issues that need to be triaged. label Aug 22, 2022
elijahbenizzy added a commit that referenced this issue Aug 22, 2022
Need to add a few more pieces to make this work -- this is a WIP.
elijahbenizzy added a commit that referenced this issue Aug 22, 2022
Need to add a few more pieces to make this work -- this is a WIP.
elijahbenizzy added a commit that referenced this issue Aug 26, 2022
…eadable.

Adds the following features for #186:

1. The ability to have more complex arguments
2. The ability to have an argument mapping

All of this is documented. Note we remove the typing
constraint checking for the replacing function. This enables
more complex polymorphically applicable functions without
the pain of implementing sophisticated type-checking.

Note this also fixes it breaking with optional dependencies (#185)
elijahbenizzy added a commit that referenced this issue Aug 28, 2022
…eadable.

Adds the following features for #186:

1. The ability to have more complex arguments
2. The ability to have an argument mapping

All of this is documented.

Note this also fixes it breaking with optional dependencies (#185)
elijahbenizzy added a commit that referenced this issue Aug 29, 2022
…eadable.

Adds the following features for #186:

1. The ability to have more complex arguments
2. The ability to have an argument mapping

All of this is documented.

Note this also fixes it breaking with optional dependencies (#185)
elijahbenizzy added a commit that referenced this issue Aug 30, 2022
…eadable.

Adds the following features for #186:

1. The ability to have more complex arguments
2. The ability to have an argument mapping

All of this is documented.

Note this also fixes it breaking with optional dependencies (#185)
@elijahbenizzy
Copy link
Collaborator Author

This is fixed!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants