Skip to content

✨ Add support for hybrid_property #482

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 2 commits into
base: main
Choose a base branch
from
Open

✨ Add support for hybrid_property #482

wants to merge 2 commits into from

Conversation

van51
Copy link
Contributor

@van51 van51 commented Oct 31, 2022

Attempt to solve #299 and add support for hybrid_property properties.

@github-actions
Copy link

📝 Docs preview for commit 55c9526 at: https://635fb362686fae1e8384a5e3--sqlmodel.netlify.app

@github-actions
Copy link

📝 Docs preview for commit f5a474f at: https://635fb41dc6090b1e80805996--sqlmodel.netlify.app

@van51
Copy link
Contributor Author

van51 commented Nov 1, 2022

The proposed addition was working correctly for sqlalchemy==1.4.23, but on the latest sqlalchemy==1.4.41 is not working anymore. The error is shown on the checks above. I'll try to pinpoint what has changed.

@github-actions
Copy link

github-actions bot commented Nov 2, 2022

📝 Docs preview for commit a7ec9ff at: https://6362568c806a400cb061aacd--sqlmodel.netlify.app

@codecov
Copy link

codecov bot commented Nov 2, 2022

Codecov Report

Base: 98.49% // Head: 98.50% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (1359098) compared to base (ea79c47).
Patch coverage: 100.00% of modified lines in pull request are covered.

❗ Current head 1359098 differs from pull request most recent head 93509eb. Consider uploading reports for the commit 93509eb to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #482   +/-   ##
=======================================
  Coverage   98.49%   98.50%           
=======================================
  Files         185      186    +1     
  Lines        5856     5890   +34     
=======================================
+ Hits         5768     5802   +34     
  Misses         88       88           
Impacted Files Coverage Δ
tests/conftest.py 100.00% <100.00%> (ø)
tests/test_sqlalchemy_properties.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@github-actions
Copy link

github-actions bot commented Nov 2, 2022

📝 Docs preview for commit 32b125c at: https://6362577741a93d01dcd99ece--sqlmodel.netlify.app

@github-actions
Copy link

github-actions bot commented Nov 2, 2022

📝 Docs preview for commit 1359098 at: https://636258b54b0bfa040aa9faf9--sqlmodel.netlify.app

@github-actions
Copy link

📝 Docs preview for commit 93509eb at: https://639ce098ecf1fd03689b400e--sqlmodel.netlify.app

@shepilov-vladislav
Copy link

Any plans to solve it?

@van51
Copy link
Contributor Author

van51 commented Jan 11, 2023

Hi, it has been fixed in the current PR implementation. I had forgotten to add a comment about it.

@shepilov-vladislav
Copy link

shepilov-vladislav commented Feb 10, 2023

@van51 Any plans to merge it? I use your commit pip install git+https://github.com/van51/sqlmodel.git#93509eb and can confirm that it works as expected last 2 months. But I can't understand why it's still not merged to trunk 😅

@van51
Copy link
Contributor Author

van51 commented Feb 10, 2023

@van51 Any plans to merge it? I use your commit pip install git+https://github.com/van51/sqlmodel.git#93509eb and can confirm that it works as expected last 2 months. But I can't understand why it's still not merged to trunk 😅

Hi @shepilov-vladislav , unfortunately I don't have write access to this repository. We have to ping/mention someone from the maintainers.

I am glad to know that it works for you though :)

@shepilov-vladislav
Copy link

I see 😢 @tiangolo Can you help with this? What can we do to force this?

1 similar comment
@linpan
Copy link

linpan commented Feb 21, 2023

I see 😢 @tiangolo Can you help with this? What can we do to force this?

@1219295581
Copy link

This hybird_property is cool ,it solved my pain,hope to merge

@felimuno
Copy link

works great. hope to merge too.

@kyhorne
Copy link

kyhorne commented Jul 17, 2023

Would love to have this

@Islati
Copy link

Islati commented Sep 27, 2023

Bumping this as it really should be pulled & merged.

@tiangolo tiangolo added the feature New feature or request label Oct 22, 2023
@PipeKnight
Copy link
Contributor

@tiangolo after new releases with sqlalchemy 2.0 support, maybe it's time to merge this?

@lesleslie
Copy link

Willy Wonka: But Charlie, don’t forget what happened to the man who suddenly got everything he always wanted.
Charlie Bucket: What happened?
Willy Wonka: He lived happily ever after.

Please sir, merge and release.

@50Bytes-dev
Copy link

Use my PR #801 if you need these features

@marhoy
Copy link

marhoy commented Feb 26, 2024

@tiangolo Any ETA on this? Would be really appreciated 😊

@zzachattack2
Copy link

Good god, nearly 2-years and @tiangolo cant even be bothered to acknowledge this major shortcoming with sqlmodel? And this is even a PR vs just a complaint in an issue? Damn.

I guess this is a prime example of why we are quickly reverting our short-lived idea about migrating our codebade to SQLModel.

@TheCodingLand
Copy link

@tiangolo any comment on this?
I think a lot of people would apreciate this merge.

@zzachattack2
Copy link

zzachattack2 commented Oct 17, 2024

Honestly it's probably best to just kill the PR. This is a dead project. Hopefully author has enough courtesy to archive it without wasting anymore dev's time. Understandably, he probably got carried away with repackaging useful libraries with typing and pydantic... given the success of FastAPI... but SQLAlchemy was too big and complex of a library of keep up with, and largely took care of typing issues on their own.

@MaffooBristol
Copy link

I believe you can just use Pydantic's @computed_field instead. Seems to work exactly the same, at least from what I can tell without going too deeply into advanced cases.

This is a dead project. Hopefully author [who gives us this for free] has enough courtesy to archive it without wasting anymore dev's time.

Good god, nearly 2-years and [author who does this all for free] cant even be bothered to acknowledge this major shortcoming with [project that is given away for free]

Grow up dude

@zzachattack2
Copy link

I believe you can just use Pydantic's @computed_field instead. Seems to work exactly the same, at least from what I can tell without going too deeply into advanced cases.

This is a dead project. Hopefully author [who gives us this for free] has enough courtesy to archive it without wasting anymore dev's time.

Good god, nearly 2-years and [author who does this all for free] cant even be bothered to acknowledge this major shortcoming with [project that is given away for free]

Grow up dude

Your belief on computed fields ref this issue is so very much incorrect.

But to your other point - there are potential contributors who are/were attempting to fix this issue, whom the author has blatantly ignored. There is a big difference between ignoring an "issue" and ignoring several PRs to fix said issue.

Ultimately, it's just poor management of an open source project. If the author is too busy with other projects to bother with this one, which is 100% understandable, the proper thing would be to either archive it, or permit others to come on board to help maintain it.

My complaint was not that he can or will not spend his time to fix , but rather that he will not even allow someone else to fix .

Grow up.

@jdoss
Copy link

jdoss commented Feb 6, 2025

@zzachattack2 Can we please keep this kind of comments out of PRs? We get it. You are frustrated with a free and open source project. Fork it and move on with your life if you think you can do a better job maintaining it. @tiangolo doesn't owe you or anyone anything and your comments are toxic and unhelpful.

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

Successfully merging this pull request may close these issues.