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

AttributeError when sqlalchemy model has field created by column_property #125

Open
phaethon opened this issue Feb 17, 2024 · 0 comments
Open
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@phaethon
Copy link

phaethon commented Feb 17, 2024

I have a model, which includes column_property

class User(Base):
  name = Column(Text)
  lastname = Column(Text)
  full_name = column_property(name + " " + lastname)

When I start application I get this stack trace:

...
  File "/home/myhome/strawberry-test/lib/python3.10/site-packages/strawberry_sqlalchemy_mapper/mapper.py", line 371, in _convert_column_to_strawberry_type
    if column.nullable:
  File "/home/myhome/strawberry-test/lib/python3.10/site-packages/sqlalchemy/sql/elements.py", line 1495, in __getattr__
    raise AttributeError(
AttributeError: Neither 'Label' object nor 'Comparator' object has an attribute 'nullable'

If I comment out the full_name field in the model, it works as expected.

Ubuntu 22.04, python 3.10, SQLAlchemy 2.027, psycopg 3.1.18, strawberry-sqlalchemy-mapper 0.4.2, strawberry-graphql 0.219.2

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@phaethon phaethon added the bug Something isn't working label Feb 17, 2024
@Ckk3 Ckk3 added the help wanted Extra attention is needed label Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants