Skip to content

fix(setup): allow non callable values #1070

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shcheklein
Copy link
Member

@shcheklein shcheklein commented Apr 30, 2025

Fixes #1069

Allow regular values in setup():

client=anthropic.Anthropic(api_key=API_KEY) instead of using lambda: client=lambda: anthropic.Anthropic(api_key=API_KEY)

Callable is still supported and cached.

TODO:

  • Needs some testing with distributed mode (can we serialize non callable properly)
  • Update docs

Copy link

cloudflare-workers-and-pages bot commented Apr 30, 2025

Deploying datachain-documentation with  Cloudflare Pages  Cloudflare Pages

Latest commit: cbcfd19
Status: ✅  Deploy successful!
Preview URL: https://fbe151c5.datachain-documentation.pages.dev
Branch Preview URL: https://fix-1069-setup-non-callable.datachain-documentation.pages.dev

View logs

@shcheklein shcheklein force-pushed the fix-1069/setup-non-callable branch from 036015f to 50e5f1e Compare April 30, 2025 22:54
@shcheklein shcheklein force-pushed the fix-1069/setup-non-callable branch from 50e5f1e to cbcfd19 Compare April 30, 2025 23:45
@shcheklein shcheklein requested review from dreadatour and a team April 30, 2025 23:47
Copy link

codecov bot commented Apr 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.14%. Comparing base (d0044b5) to head (cbcfd19).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1070      +/-   ##
==========================================
- Coverage   88.14%   88.14%   -0.01%     
==========================================
  Files         146      146              
  Lines       12508    12505       -3     
  Branches     1742     1740       -2     
==========================================
- Hits        11025    11022       -3     
  Misses       1059     1059              
  Partials      424      424              
Flag Coverage Δ
datachain 88.06% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@shcheklein
Copy link
Member Author

@dreadatour do you foresee any potential issues in the distributed mode (where we serialize values). As far as I understand now we can serialize callable (do we do this?), while after this change it will be an object. Not sure if there are any issues with this.

@shcheklein
Copy link
Member Author

@dreadatour when you have a minute, could please take a look :) should be a small PR ... my only question is about serialize / deserialize logic - if it is impacted or not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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