Skip to content

Py2 SQLAlchemy: Move some TypeEngine functions from subclasses to TypeEngine - #724

Merged
gvanrossum merged 4 commits into
python:masterfrom
TRManderson:patch-2
Dec 13, 2016
Merged

gvanrossum merged 4 commits into
python:masterfrom
TRManderson:patch-2

Conversation

@TRManderson

@TRManderson TRManderson commented Nov 30, 2016 •

Copy link
Copy Markdown
Contributor

Not sure about:

@util.memoized_property
def _expression_adaptations:...

which is also defined on datetime

class DateTime(TypeEngine, _DateAffinity):
def __init__(self, timezone=None): ...
@property
def python_type(self): ...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, instead of here, add this property on TypeEngine, it's defined there and available on all types.

def __init__(self, timezone=None): ...
@property
def python_type(self): ...
def get_dbapi_type(self, dbapi): ...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TRManderson TRManderson changed the title Add timezone to SQLAlchemy datetime constructor Py2 SQLAlchemy: Move some TypeEngine functions from subclasses to TypeEngine Dec 5, 2016
@TRManderson

Copy link
Copy Markdown
Contributor Author

It's not at all clear to me why the build is failing, so I'll just leave this as is for now.

@gvanrossum

Copy link
Copy Markdown
Member

The linter is complaining about these two lines:

third_party/2/sqlalchemy/sql/type_api.pyi:5: error: Inconsistent indentation
third_party/2/sqlalchemy/sql/type_api.pyi:12: error: Inconsistent indentation

@@ -2,6 +2,13 @@ from .. import util
from .visitors import Visitable, VisitableType

class TypeEngine(Visitable): ...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to remove these "..." from this line.

@gvanrossum

gvanrossum commented Dec 5, 2016 via email

Copy link
Copy Markdown
Member

@TRManderson

Copy link
Copy Markdown
Contributor Author

Thanks Guido, that's what I get for making PRs before coffee. Pushing a fix now.

@gvanrossum

Copy link
Copy Markdown
Member

LGTM. @ambv can you do the honors?

@gvanrossum
gvanrossum merged commit 5dbc7d1 into python:master Dec 13, 2016
@gvanrossum

Copy link
Copy Markdown
Member

I've merged this despite the pending review (over a week old). It seems simple enough.

Now we have to see whether this causes a merge conflict with #719...

@TRManderson
TRManderson deleted the patch-2 branch December 14, 2016 01:19
hswong3i pushed a commit to alvistack/python-typeshed that referenced this pull request May 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants