From e90f8bcc33cca5adcf1116f65b3edab47eb9bfc4 Mon Sep 17 00:00:00 2001 From: Tom Manderson Date: Wed, 30 Nov 2016 14:57:13 +1000 Subject: [PATCH 1/4] Add timezone to SQLAlchemy datetime constructor --- third_party/2/sqlalchemy/sql/sqltypes.pyi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/third_party/2/sqlalchemy/sql/sqltypes.pyi b/third_party/2/sqlalchemy/sql/sqltypes.pyi index 9c9806a87812..bd1d0abf9a05 100644 --- a/third_party/2/sqlalchemy/sql/sqltypes.pyi +++ b/third_party/2/sqlalchemy/sql/sqltypes.pyi @@ -23,7 +23,11 @@ class SmallInteger(Integer): ... class BigInteger(Integer): ... class Numeric(TypeEngine, _DateAffinity): ... class Float(Numeric): ... -class DateTime(TypeEngine, _DateAffinity): ... +class DateTime(TypeEngine, _DateAffinity): + def __init__(self, timezone=None): ... + @property + def python_type(self): ... + def get_dbapi_type(self, dbapi): ... class Date(TypeEngine, _DateAffinity): ... class Time(TypeEngine, _DateAffinity): ... class _Binary(TypeEngine): ... From 5eeee8820673cdd2d3f1246046557a0aa36a0233 Mon Sep 17 00:00:00 2001 From: Tom Manderson Date: Mon, 5 Dec 2016 11:51:41 +1000 Subject: [PATCH 2/4] Move some TypeEngine functions from subclasses to TypeEngine --- third_party/2/sqlalchemy/sql/sqltypes.pyi | 9 --------- third_party/2/sqlalchemy/sql/type_api.pyi | 6 ++++++ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/third_party/2/sqlalchemy/sql/sqltypes.pyi b/third_party/2/sqlalchemy/sql/sqltypes.pyi index bd1d0abf9a05..6c51ef7d813f 100644 --- a/third_party/2/sqlalchemy/sql/sqltypes.pyi +++ b/third_party/2/sqlalchemy/sql/sqltypes.pyi @@ -8,12 +8,6 @@ class String(TypeEngine, Concatenable): convert_unicode=False, unicode_error=None, _warn_on_bytestring=False): ... - def literal_processor(self, dialect): ... - def bind_processor(self, dialect): ... - def result_processor(self, dialect, coltype): ... - @property - def python_type(self): ... - def get_dbapi_type(self, dbapi): ... class Text(String): ... class Unicode(String): ... @@ -25,9 +19,6 @@ class Numeric(TypeEngine, _DateAffinity): ... class Float(Numeric): ... class DateTime(TypeEngine, _DateAffinity): def __init__(self, timezone=None): ... - @property - def python_type(self): ... - def get_dbapi_type(self, dbapi): ... class Date(TypeEngine, _DateAffinity): ... class Time(TypeEngine, _DateAffinity): ... class _Binary(TypeEngine): ... diff --git a/third_party/2/sqlalchemy/sql/type_api.pyi b/third_party/2/sqlalchemy/sql/type_api.pyi index ccc0870c0d88..d4e0284b0f46 100644 --- a/third_party/2/sqlalchemy/sql/type_api.pyi +++ b/third_party/2/sqlalchemy/sql/type_api.pyi @@ -2,6 +2,12 @@ from .. import util from .visitors import Visitable, VisitableType class TypeEngine(Visitable): ... + @property + def python_type(self): ... + def get_dbapi_type(self, dbapi): ... + def literal_processor(self, dialect): ... + def bind_processor(self, dialect): ... + def result_processor(self, dialect, coltype): ... class VisitableCheckKWArg(util.EnsureKWArgType, VisitableType): ... # TODO: class UserDefinedType(util.with_metaclass(VisitableCheckKWArg, TypeEngine)): class UserDefinedType(VisitableCheckKWArg, TypeEngine): ... From c9ea50bc1b512bfe63cb632123ee3965b2637fd4 Mon Sep 17 00:00:00 2001 From: Tom Manderson Date: Mon, 5 Dec 2016 12:23:03 +1000 Subject: [PATCH 3/4] Add newline in an attempt to make build pass --- third_party/2/sqlalchemy/sql/type_api.pyi | 1 + 1 file changed, 1 insertion(+) diff --git a/third_party/2/sqlalchemy/sql/type_api.pyi b/third_party/2/sqlalchemy/sql/type_api.pyi index d4e0284b0f46..066a08b94330 100644 --- a/third_party/2/sqlalchemy/sql/type_api.pyi +++ b/third_party/2/sqlalchemy/sql/type_api.pyi @@ -8,6 +8,7 @@ class TypeEngine(Visitable): ... def literal_processor(self, dialect): ... def bind_processor(self, dialect): ... def result_processor(self, dialect, coltype): ... + class VisitableCheckKWArg(util.EnsureKWArgType, VisitableType): ... # TODO: class UserDefinedType(util.with_metaclass(VisitableCheckKWArg, TypeEngine)): class UserDefinedType(VisitableCheckKWArg, TypeEngine): ... From cd6e7dd354ee4402277ebb1657eff55367b557e3 Mon Sep 17 00:00:00 2001 From: Tom Manderson Date: Mon, 5 Dec 2016 14:51:06 +1000 Subject: [PATCH 4/4] Remove defunct ellipsis --- third_party/2/sqlalchemy/sql/type_api.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/2/sqlalchemy/sql/type_api.pyi b/third_party/2/sqlalchemy/sql/type_api.pyi index 066a08b94330..9b8d0e87ee5a 100644 --- a/third_party/2/sqlalchemy/sql/type_api.pyi +++ b/third_party/2/sqlalchemy/sql/type_api.pyi @@ -1,7 +1,7 @@ from .. import util from .visitors import Visitable, VisitableType -class TypeEngine(Visitable): ... +class TypeEngine(Visitable): @property def python_type(self): ... def get_dbapi_type(self, dbapi): ...