]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
docs(types) Fix missing import from sqlalchemy (#7978)
authorkhashashin <khashashin@users.noreply.github.com>
Tue, 3 May 2022 20:00:59 +0000 (22:00 +0200)
committerGitHub <noreply@github.com>
Tue, 3 May 2022 20:00:59 +0000 (22:00 +0200)
* docs(types) Fix missing import from sqlalchemy

The sample code is missing the import of Enum from sqlalchemy, which might confuse the reader, since we are using another enum type from Python itself here. So it makes sense to clarify that here.

* fix whitespaces

Change-Id: I019bbed8a7278f60e7239160ea4c99ecd2519d3b

Co-authored-by: Federico Caselli <cfederico87@gmail.com>
lib/sqlalchemy/sql/sqltypes.py

index d2d5e4e87d4887c648f32b1f0d9ae530f69aec11..4b0b408f7f239152edabb6c3c3f32d74435d8769 100644 (file)
@@ -1183,6 +1183,8 @@ class Enum(String, SchemaType, Emulated, TypeEngine[Union[str, enum.Enum]]):
     a plain-string enumerated type::
 
         import enum
+        from sqlalchemy import Enum
+
         class MyEnum(enum.Enum):
             one = 1
             two = 2