Repository: litestar-org/polyfactory (python)

Issue:
Bug: Try to use SQLAlchemyFactory for model with column_property
### Description

Create model with declared `column_property` and try create model object with it.

Got error `AttributeError: Neither 'Label' object nor 'Comparator' object has an attribute 'nullable'`

### URL to code causing the issue

_No response_

### MCVE

```python
from sqlalchemy import Integer, String
from sqlalchemy.orm import DeclarativeBase, column_property, mapped_column

from polyfactory.factories.sqlalchemy_factory import SQLAlchemyFactory


class Base(DeclarativeBase):
    ...


class Student(Base):
    __tablename__ = "user"
    id = mapped_column(Integer(), primary_key=True)
    firstname = mapped_column(String(50))
    lastname = mapped_column(String(50))
    fullname = column_property(firstname + " " + lastname)


class StudentFactory(SQLAlchemyFactory[Student]):
    __model__ = Student
    __set_relationships__ = True
    __set_foreign_keys__ = False


student = StudentFactory.build()
```


### Steps to reproduce

```bash
1. Define SQLAlchemy model with column_property
2. Define SQLAlchemyFactory with model
3. Try to create object with factory
```


### Screenshots

_No response_

### Logs

```bash
tests/test_api/test_student/test_change_teacher.py:100: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.venv/lib/python3.11/site-packages/polyfactory/factories/base.py:1031: in build
    return cast("T", cls.__model__(**cls.process_kwargs(**kwargs)))
.venv/lib/python3.11/site-packages/polyfactory/factories/base.py:931: in process_kwargs
    for field_meta in cls.get_model_fields():
.venv/lib/python3.11/site-packages/polyfactory/factories/sqlalchemy_factory.py:141: in get_model_fields
    fields_meta.extend(
.venv/lib/python3.11/site-packages/polyfactory/factories/sqlalchemy_factory.py:143: in <genexpr>
    annotation=cls.get_type_from_column(column),
.venv/lib/python3.11/site-packages/polyfactory/factories/sqlalchemy_factory.py:131: in get_type_from_column
    if column.nullable:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <sqlalchemy.sql.elements.Label at 0x1079e01d0; %(4422762960 anon)s>, key = 'nullable'

    def __getattr__(self, key: str) -> Any:
        try:
            return getattr(self.comparator, key)
        except AttributeError as err:
>           raise AttributeError(
                "Neither %r object nor %r object has an attribute %r"
                % (
                    type(self).__name__,
                    type(self.comparator).__name__,
                    key,
                )
            ) from err
E           AttributeError: Neither 'Label' object nor 'Comparator' object has an attribute 'nullable'

.venv/lib/python3.11/site-packages/sqlalchemy/sql/elements.py:1604: AttributeError
----------------------------------------------------------------- Captured stderr setup -----------------------------------------------------------------
Context impl PostgresqlImpl.
Will assume transactional DDL.
----------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------
student.first_name || :param_1 || student.last_name  # add my print to find a column with problem
```


### Release Version

2.9.0

### Platform

- [X] Linux
- [X] Mac
- [ ] Windows
- [ ] Other (Please specify in the description above)

<!-- POLAR PLEDGE BADGE START -->
---
> [!NOTE]  
> While we are open for sponsoring on [GitHub Sponsors](https://github.com/sponsors/litestar-org/) and 
> [OpenCollective](https://opencollective.com/litestar), we also utilize [Polar.sh](https://polar.sh/) to engage in pledge-based sponsorship.
>
> Check out all issues funded or available for funding [on our Polar.sh dashboard](https://polar.sh/litestar-org)
> * If you would like to see an issue prioritized, make a pledge towards it!
> * We receive the pledge once the issue is completed & verified
> * This, along with engagement in the community, helps us know which features are a priority to our users.

<a href="https://polar.sh/litestar-org/polyfactory/issues/508">
<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://polar.sh/api/github/litestar-org/polyfactory/issues/508/pledge.svg?darkmode=1">
  <img alt="Fund with Polar" src="https://polar.sh/api/github/litestar-org/polyfactory/issues/508/pledge.svg">
</picture>
</a>
<!-- POLAR PLEDGE BADGE END -->


Pull request description:
fix: ignore non-columns types
<!--
By submitting this pull request, you agree to:
- follow [Litestar's Code of Conduct](https://github.com/litestar-org/.github/blob/main/CODE_OF_CONDUCT.md)
- follow [Litestar's contribution guidelines](https://github.com/litestar-org/.github/blob/main/CONTRIBUTING.md)
- follow the [PSFs's Code of Conduct](https://www.python.org/psf/conduct/)
-->

### Pull Request Checklist

- [ ] New code has 100% test coverage
- [ ] (If applicable) The prose documentation has been updated to reflect the changes introduced by this PR
- [ ] (If applicable) The reference documentation has been updated to reflect the changes introduced by this PR
- [ ] Pre-Commit Checks were ran and passed
- [ ] Tests were ran and passed

### Description
<!--
Please describe your pull request for new release changelog purposes
-->

- 

### Close Issue(s)
<!--
Please add in issue numbers this pull request will close, if applicable
Examples: Fixes #4321 or Closes #1234
-->

-  Fixes #508 


Patch:
diff --git a/polyfactory/factories/sqlalchemy_factory.py b/polyfactory/factories/sqlalchemy_factory.py
index ad8873f..62a7c0a 100644
--- a/polyfactory/factories/sqlalchemy_factory.py
+++ b/polyfactory/factories/sqlalchemy_factory.py
@@ -112,7 +112,10 @@ class SQLAlchemyFactory(Generic[T], BaseFactory[T]):
         return isinstance(inspected, (Mapper, InstanceState))
 
     @classmethod
-    def should_column_be_set(cls, column: Column) -> bool:
+    def should_column_be_set(cls, column: Any) -> bool:
+        if not isinstance(column, Column):
+            return False
+
         if not cls.__set_primary_key__ and column.primary_key:
             return False
 


Test patch:
diff --git a/tests/sqlalchemy_factory/test_sqlalchemy_factory_common.py b/tests/sqlalchemy_factory/test_sqlalchemy_factory_common.py
index 8cdcf66..6a7657d 100644
--- a/tests/sqlalchemy_factory/test_sqlalchemy_factory_common.py
+++ b/tests/sqlalchemy_factory/test_sqlalchemy_factory_common.py
@@ -6,6 +6,7 @@ import pytest
 from sqlalchemy import Column, ForeignKey, Integer, String, create_engine, inspect, orm, types
 from sqlalchemy.engine import Engine
 from sqlalchemy.ext.asyncio import AsyncEngine, AsyncSession, create_async_engine
+from sqlalchemy.ext.hybrid import hybrid_property
 from sqlalchemy.orm import Session
 from sqlalchemy.orm.decl_api import DeclarativeMeta, registry
 
@@ -119,6 +120,37 @@ def test_python_type_handling() -> None:
     assert isinstance(instance.str_array_type[0], str)
 
 
+def test_properties() -> None:
+    _registry = registry()
+
+    class Base(metaclass=DeclarativeMeta):
+        __abstract__ = True
+
+        registry = _registry
+        metadata = _registry.metadata
+
+    class Model(Base):
+        __tablename__ = "model"
+
+        id: Any = Column(Integer(), primary_key=True)
+        age: Any = Column(Integer(), nullable=False)
+
+        double_age = orm.column_property(age * 2)
+
+        @hybrid_property
+        def triple_age(self) -> int:
+            return self.age * 3  # type: ignore[no-any-return]
+
+    class ModelFactory(SQLAlchemyFactory[Model]):
+        ...
+
+    instance = ModelFactory.build()
+    assert isinstance(instance, Model)
+    # Expect empty as requires session to be set
+    assert instance.double_age is None
+    assert instance.age * 3 == instance.triple_age
+
+
 @pytest.mark.parametrize(
     "type_",
     tuple(SQLAlchemyFactory.get_sqlalchemy_types().keys()),