From 267cd42fb6c17b43a8edb738da1b689af6909300 Mon Sep 17 00:00:00 2001 From: Colin Marquardt Date: Sat, 12 Nov 2022 07:44:19 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Fix=20typo=20in=20internal?= =?UTF-8?q?=20function=20name=20`get=5Fsqlachemy=5Ftype()`=20(#496)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Corrected name is get_sqlalchemy_type(). --- sqlmodel/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sqlmodel/main.py b/sqlmodel/main.py index d343c69..d95c498 100644 --- a/sqlmodel/main.py +++ b/sqlmodel/main.py @@ -371,7 +371,7 @@ class SQLModelMetaclass(ModelMetaclass, DeclarativeMeta): ModelMetaclass.__init__(cls, classname, bases, dict_, **kw) -def get_sqlachemy_type(field: ModelField) -> Any: +def get_sqlalchemy_type(field: ModelField) -> Any: if issubclass(field.type_, str): if field.field_info.max_length: return AutoString(length=field.field_info.max_length) @@ -418,7 +418,7 @@ def get_column_from_field(field: ModelField) -> Column: # type: ignore sa_column = getattr(field.field_info, "sa_column", Undefined) if isinstance(sa_column, Column): return sa_column - sa_type = get_sqlachemy_type(field) + sa_type = get_sqlalchemy_type(field) primary_key = getattr(field.field_info, "primary_key", False) index = getattr(field.field_info, "index", Undefined) if index is Undefined: