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

functools.lru_cache() makes hamilton think a function is not a node #178

Closed
elijahbenizzy opened this issue Aug 11, 2022 · 3 comments
Closed
Assignees
Labels
triage label for issues that need to be triaged.

Comments

@elijahbenizzy
Copy link
Collaborator

IMO this is actually just sloppiness on the implementation of lru_cache, not layerable. Need to verify 100% that this is the cause, but we should fix.

Current behavior

Stack Traces

(If applicable)

Screenshots

(If applicable)

Steps to replicate behavior

@functools.lru_cache(maxsize=None)
def config() -> Dict[str, Any]:
    return _load_config()

def foo(config: Dict[str, Any]):
    return config['foo']
  File "/Users/elijahbenizzy/dev/hamilton-os/hamilton/hamilton/driver.py", line 203, in visualize_execution
    self.validate_inputs(user_nodes, inputs)
  File "/Users/elijahbenizzy/dev/hamilton-os/hamilton/hamilton/driver.py", line 99, in validate_inputs
    raise ValueError(error_str)
ValueError: 2 errors encountered:
  Error: Required input config not provided for nodes: ['foo'].

Library & System Information

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

Expected behavior

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 11, 2022
@elijahbenizzy
Copy link
Collaborator Author

Note this is a workaround for #17

@elijahbenizzy
Copy link
Collaborator Author

I think this can be fixed in Node -- need to mess with it. Will take on.

@elijahbenizzy
Copy link
Collaborator Author

We are moving repositories! Please see the new version of this issue at DAGWorks-Inc/hamilton#43. Also, please give us a star/update any of your internal links.

Note that everything else (slack community, pypi packages, etc...) will not change at all.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
triage label for issues that need to be triaged.
Projects
None yet
Development

No branches or pull requests

1 participant