ITADN

[Bug report] SAWarning with MariaDB - Did not recognize type 'point' of column 'gps_location'

#559Closedlclbm 创建于 2025-05-27
bug
L
lclbmcommented
### Describe the bug SAWarning: Did not recognize type 'point' of column 'gps_location' when reflecting metadata with GeoAlchemy2 and MariaDB. package version: - mariadb: mariadb from 11.7.2-MariaDB - sqlalchemy: 2.0.41 - geoalchemy2: 0.17.1 ### Optional link from https://geoalchemy-2.readthedocs.io which documents the behavior that is expected _No response_ ### To Reproduce ```Python from typing import Annotated from sqlalchemy import String, create_engine, MetaData from sqlalchemy.orm import Mapped, DeclarativeBase, MappedAsDataclass, mapped_column from geoalchemy2 import Geometry schema = "test_2" url = "mariadb+pymysql://root:password@localhost:3306/test_2?charset=utf8mb4" engine = create_engine(url.format(schema), echo=True, plugins=["geoalchemy2"]) class Base(DeclarativeBase): ... IntPK = Annotated[int, mapped_column(primary_key=True, autoincrement=True)] class Phone(MappedAsDataclass, Base): __tablename__ = "phones" id: Mapped[IntPK] = mapped_column(init=False) gps_location = mapped_column( Geometry(geometry_type="POINT", srid=4326), nullable=False ) Base.metadata.create_all(engine) meta = MetaData() meta.reflect(bind=engine) ``` ### Error ```Python traceback SAWarning: Did not recognize type 'point' of column 'gps_location' meta.reflect(bind=engine) ``` ### Additional context #### Table DDL ``` -- test_2.phones definition CREATE TABLE `phones` ( `id` int(11) NOT NULL AUTO_INCREMENT, `gps_location` point NOT NULL, `description` varchar(100) DEFAULT NULL, PRIMARY KEY (`id`), SPATIAL KEY `gps_location` (`gps_location`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; ``` ### GeoAlchemy 2 Version in Use 0.17.1 ### Python Version 3.12.9 ### Operating system Windows
关闭于 2025-05-27 7 条评论