- 
                Notifications
    
You must be signed in to change notification settings  - Fork 328
 
docs: adds daft.func and daft.cls usage with migration page #5475
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
base: main
Are you sure you want to change the base?
docs: adds daft.func and daft.cls usage with migration page #5475
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Overview
Greptile Summary
This PR reorganizes and expands the documentation for custom Python code in Daft, separating functions and classes into dedicated pages and adding a comprehensive migration guide.
Key Changes
- Separated documentation: Split 
@daft.funcand@daft.clsinto separate pages (func.mdandcls.md) for better clarity - New migration guide: Added 
comparison.mdwith detailed migration instructions, FAQ, and side-by-side examples comparing legacy@daft.udfto next-gen APIs - Reorganized navigation: Renamed section to "Scale Custom Python Code" and reordered pages to prioritize next-gen UDFs over legacy
 - File reorganization: Moved 
sessions-usage.mdtoconfiguration/directory with updated title "Sessions, Catalogs, and Tables" - Examples enhancement: Added reference to the new 
daft-examplesrepository at the top of the examples index - Updated cross-references: Fixed all internal links to reflect the new file locations
 
Issues Found
- Typos in comparison.md: "anda batch" should be "and a batch" (line 7), "re-tunewith" should be "re-tune with" (line 18)
 - Broken reference links: Undefined markdown references 
[1],[2], and[8]that won't render properly - Empty link targets: Two links in the "See also" section have empty 
()targets 
Confidence Score: 4/5
- This PR is safe to merge after fixing the typos and broken links in comparison.md
 - Score reflects that this is a documentation-only change with good content and organization, but has several typos and broken links that should be fixed before merging. The issues are minor and easily correctable.
 - docs/custom-code/comparison.md requires attention to fix typos and broken reference links
 
Important Files Changed
File Analysis
| Filename | Score | Overview | 
|---|---|---|
| docs/custom-code/comparison.md | 3/5 | New migration guide added with typos and broken reference links that need fixing | 
| docs/custom-code/cls.md | 5/5 | New documentation for stateful class UDFs - well structured and comprehensive | 
| docs/custom-code/func.md | 5/5 | Refactored to focus on stateless functions, moved class content to cls.md | 
| docs/custom-code/index.md | 5/5 | Updated overview page with clear quick example and link to comparison guide | 
| docs/SUMMARY.md | 5/5 | Navigation restructured with clearer titles and better organization of UDF docs | 
Sequence Diagram
sequenceDiagram
    participant User
    participant Docs as Documentation Site
    participant Nav as Navigation (SUMMARY.md)
    participant UDF as Custom Code Section
    
    User->>Docs: Navigate to Custom Python Code
    Docs->>Nav: Load navigation structure
    Nav->>UDF: Display "Scale Custom Python Code"
    UDF->>UDF: Show index.md overview
    
    alt User wants Next-Gen UDFs
        User->>UDF: Click "Functions" or "Classes & Methods"
        UDF->>Docs: Load func.md or cls.md
    else User wants to migrate
        User->>UDF: Click "Compare: Next-Gen vs Legacy"
        UDF->>Docs: Load comparison.md
    else User has legacy code
        User->>UDF: Click "Legacy UDFs"
        UDF->>Docs: Load udfs.md
    end
    
    Note over User,Docs: Related content linking
    User->>Docs: Navigate to Sessions
    Docs->>Nav: Load configuration/sessions-usage.md
    User->>Docs: Navigate to Examples
    Docs->>Nav: Load examples/index.md
    Note right of Docs: Links to daft-examples repo
    13 files reviewed, 4 comments
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: Cory Grinstead <[email protected]>
          Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@            Coverage Diff             @@
##             main    #5475      +/-   ##
==========================================
- Coverage   71.45%   70.95%   -0.50%     
==========================================
  Files        1001     1006       +5     
  Lines      126769   127690     +921     
==========================================
+ Hits        90587    90607      +20     
- Misses      36182    37083     +901     
 🚀 New features to boost your workflow:
  | 
    
| 
           @colin-ho @universalmind303 @universalmind303 We've got 3 failing docstests from a few different docstrings in the new udfs. I recommend to proceed with this docs merge following a final thumbs up from @universalmind303 and make a separate issues for these here: #5476  | 
    
Changes Made
Related Issues
None, just needs to get done.
Checklist
docs/mkdocs.ymlnavigation