Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sqlalchemy-stubs/sql/sqltypes.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Indexable(object):

# Docs say that String is unicode when DBAPI supports it
# but it should be all major DBAPIs now.
class String(Concatenable, TypeEngine[str]): # XXX: should be typing_Text
class String(Concatenable, TypeEngine[typing_Text]):
__visit_name__: str = ...
length: Optional[int] = ...
collation: Optional[str] = ...
Expand All @@ -39,7 +39,7 @@ class String(Concatenable, TypeEngine[str]): # XXX: should be typing_Text
def bind_processor(self, dialect: Dialect) -> Optional[Callable[[str], str]]: ...
def result_processor(self, dialect: Dialect, coltype: Any) -> Optional[Callable[[Optional[Any]], Optional[str]]]: ...
@property
def python_type(self) -> Type[str]: ...
def python_type(self) -> Type[typing_Text]: ...
def get_dbapi_type(self, dbapi: Any) -> Any: ...

class Text(String):
Expand Down
4 changes: 2 additions & 2 deletions test/test-data/sqlalchemy-basics.test
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class User(Base):

user = User()
reveal_type(user.id) # E: Revealed type is 'builtins.int*'
reveal_type(User.name) # E: Revealed type is 'sqlalchemy.sql.schema.Column[Union[builtins.str*, None]]'
reveal_type(User.name) # E: Revealed type is 'sqlalchemy.sql.schema.Column[Union[builtins.unicode*, None]]'
[out]

[case testColumnFieldsInferredInstance_python2]
Expand All @@ -118,5 +118,5 @@ class User(Base):

user = User()
reveal_type(user.id) # E: Revealed type is 'builtins.int*'
reveal_type(User.name) # E: Revealed type is 'sqlalchemy.sql.schema.Column[builtins.str*]'
reveal_type(User.name) # E: Revealed type is 'sqlalchemy.sql.schema.Column[builtins.unicode*]'
[out]