Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SQLAlchemy 1.2.0 compatibility #412

Merged
merged 1 commit into from
Jan 3, 2018
Merged

Fix SQLAlchemy 1.2.0 compatibility #412

merged 1 commit into from
Jan 3, 2018

Conversation

Gr1N
Copy link
Contributor

@Gr1N Gr1N commented Dec 28, 2017

Fixes #411

Related SQLAlchemy commit zzzeek/sqlalchemy@31f80b9

@codecov
Copy link

codecov bot commented Dec 28, 2017

Codecov Report

Merging #412 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #412      +/-   ##
==========================================
- Coverage   93.53%   93.52%   -0.01%     
==========================================
  Files          25       25              
  Lines        3648     3647       -1     
  Branches      194      194              
==========================================
- Hits         3412     3411       -1     
  Misses        198      198              
  Partials       38       38
Impacted Files Coverage Δ
aiopg/sa/result.py 91.04% <ø> (-0.05%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 83d9714...2be7e0f. Read the comment docs.

@asvetlov asvetlov changed the title Fix SQLAlchemy 1.2.0 compatibility (#411) Fix SQLAlchemy 1.2.0 compatibility Dec 31, 2017
@asvetlov
Copy link
Member

Does the patch work with SQLAlchemy 1.1?

@Gr1N
Copy link
Contributor Author

Gr1N commented Jan 1, 2018

@asvetlov tests are passing with version 1.1, but as you can see in commit zzzeek/sqlalchemy@31f80b9 SQLAlchemy bumped minimum required version of cx_Oracle and removed dbapi_type_map for all engines.

@@ -121,9 +120,7 @@ def __init__(self, result_proxy, metadata):
name, obj, type_ = (
colname,
None,
result_map.get(
colname,
typemap.get(coltype, sqltypes.NULLTYPE))
Copy link
Member

Choose a reason for hiding this comment

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

We can do hasattr(dialect, 'dbapi_type_map') check, and make code working with both version of sqlalchemy

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if we want to keep dbapi_type_map compatibility, I suggest something like:

typemap = getattr(dialect, 'dbapi_type_map', {})

and keep result_map as is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jettify if you prefer this way I can fix my changes

Copy link
Member

Choose a reason for hiding this comment

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

Looks good, please also add comment explaining why we do that hack

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, please review

samuelcolvin added a commit to tutorcruncher/socket-server that referenced this pull request Jan 3, 2018
samuelcolvin pushed a commit to tutorcruncher/socket-server that referenced this pull request Jan 3, 2018
* Update sqlalchemy from 1.1.15 to 1.2.0

* Update aiohttp from 2.3.5 to 2.3.7

* Update raven from 6.3.0 to 6.4.0

* Update pytest from 3.3.0 to 3.3.1

* Update pytest-aiohttp from 0.2.0 to 0.3.0

* rollback SQLAlchemy, ref aio-libs/aiopg#412

* tweaks and fixes while deploying to beta
@jettify
Copy link
Member

jettify commented Jan 3, 2018

LGTM, not sure if we we want to test aiopg with both versions of SQLA, change looks trivial. Anyway I will create ticket for to drop this hack and bump minimal required version for SQLA, after one or two releases, this will give some buffer time for upgrade.

@jettify jettify merged commit 552e0a8 into aio-libs:master Jan 3, 2018
@Gr1N
Copy link
Contributor Author

Gr1N commented Jan 3, 2018

@jettify could you please upload new version of aiopg package to PyPI? I really want to upgrade my projects to SQLAlchemy 1.2 :)

@jettify
Copy link
Member

jettify commented Jan 3, 2018

already deployed https://pypi.python.org/pypi/aiopg/0.13.2

@Gr1N
Copy link
Contributor Author

Gr1N commented Jan 3, 2018

Thanks!

@jettify
Copy link
Member

jettify commented Jan 3, 2018

Just noticed other issue: psycopg/psycopg2#594 we need to bump minimal version of psycopg2, as result half of our builds fail due to this bug.

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