Skip to content
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

🚸 Cleaner API #1723

Merged
merged 28 commits into from
Jul 15, 2024
Merged

🚸 Cleaner API #1723

merged 28 commits into from
Jul 15, 2024

Conversation

falexwolf
Copy link
Member

@falexwolf falexwolf commented Jul 9, 2024

VSCode builds their auto-complete completely statically. The only way to arrive at a clean API while still directly leveraging subclasses of Django Model is by making the internal Django API private.

This is now achieved when running:

lamin set private-django-api true

Also, we define Registry class methods via a meta class. Thanks, @Koncopd!

Here is an extensive conversation with Claude 3.5 Sonnet on why this seems to best compromise. Other routes we investigated were, e.g., building the Registry class via composition rather than inheritance.

Below are screenshots for the auto-complete experience in JupyterLab and VSCode.

Before After
image image
image image

What still doesn't work are backwards fields that are dynamically generated by Django. These are going to be added through type annotations in another PR.

See:

@falexwolf falexwolf changed the title 🔥 Clean up Django methods 🚸 Cleaner API Jul 10, 2024
Copy link

github-actions bot commented Jul 15, 2024

@github-actions github-actions bot temporarily deployed to pull request July 15, 2024 13:02 Inactive
Copy link

codecov bot commented Jul 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.14%. Comparing base (4f1797e) to head (4b8eae0).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1723      +/-   ##
==========================================
+ Coverage   92.12%   92.14%   +0.02%     
==========================================
  Files          50       50              
  Lines        5496     5476      -20     
==========================================
- Hits         5063     5046      -17     
+ Misses        433      430       -3     

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

@github-actions github-actions bot temporarily deployed to pull request July 15, 2024 13:59 Inactive
@falexwolf falexwolf merged commit 76c11f4 into main Jul 15, 2024
12 checks passed
@falexwolf falexwolf deleted the cleanupdjango branch July 15, 2024 14:30
@github-actions github-actions bot temporarily deployed to pull request July 15, 2024 14:31 Inactive
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.

1 participant