datachain icon indicating copy to clipboard operation
datachain copied to clipboard

`setup()` support any value, not only callable / function

Open shcheklein opened this issue 8 months ago • 4 comments

Now we are getting an error that looks like:

datachain.lib.signal_schema.SetupError: cannot setup value 'client': value must be function or callable class

This is confusing and requires a non obvious workaround, e.g.:

client=lambda: anthropic.Anthropic(api_key=API_KEY)

(Note: the lambda above)

We should be able to just do:

client=anthropic.Anthropic(api_key=API_KEY) as well.

  • [ ] Don't forget to update docs

shcheklein avatar Apr 29 '25 16:04 shcheklein

For the reference - https://github.com/iterative/dvcx/pull/1712

shcheklein avatar Apr 30 '25 02:04 shcheklein

Closing, won't implement this since it might lead to bad script with very heavy object potentially passed across distributed workers.

shcheklein avatar Aug 17 '25 17:08 shcheklein

@shcheklein it still feels necessary, even if someone could misuse it.

dmpetrov avatar Aug 17 '25 23:08 dmpetrov

let's reopen it

dmpetrov avatar Sep 02 '25 17:09 dmpetrov