Hello community,
here is the log from the commit of package python-SQLAlchemy-Utils for
openSUSE:Factory checked in at 2019-06-17 10:34:20
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-SQLAlchemy-Utils (Old)
and /work/SRC/openSUSE:Factory/.python-SQLAlchemy-Utils.new.4811 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-SQLAlchemy-Utils"
Mon Jun 17 10:34:20 2019 rev:18 rq:710134 version:0.34.0
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-SQLAlchemy-Utils/python-SQLAlchemy-Utils.changes
2019-01-21 11:03:34.667025697 +0100
+++
/work/SRC/openSUSE:Factory/.python-SQLAlchemy-Utils.new.4811/python-SQLAlchemy-Utils.changes
2019-06-17 10:34:37.357225729 +0200
@@ -1,0 +2,9 @@
+Sat Jun 15 15:51:10 UTC 2019 - Arun Persaud <[email protected]>
+
+- update to version 0.34.0:
+ * Removed array_agg compilation which was never a good idea and
+ collided with the latest version of SA. (#374)
+ * Removed deprecation warnings (#373, pull request courtesy of
+ pbasista)
+
+-------------------------------------------------------------------
Old:
----
SQLAlchemy-Utils-0.33.11.tar.gz
New:
----
SQLAlchemy-Utils-0.34.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-SQLAlchemy-Utils.spec ++++++
--- /var/tmp/diff_new_pack.9xi36X/_old 2019-06-17 10:34:37.961225427 +0200
+++ /var/tmp/diff_new_pack.9xi36X/_new 2019-06-17 10:34:37.965225425 +0200
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-SQLAlchemy-Utils
-Version: 0.33.11
+Version: 0.34.0
Release: 0
Summary: Various utility functions for SQLAlchemy
License: BSD-3-Clause
++++++ SQLAlchemy-Utils-0.33.11.tar.gz -> SQLAlchemy-Utils-0.34.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SQLAlchemy-Utils-0.33.11/CHANGES.rst
new/SQLAlchemy-Utils-0.34.0/CHANGES.rst
--- old/SQLAlchemy-Utils-0.33.11/CHANGES.rst 2019-01-13 15:14:21.000000000
+0100
+++ new/SQLAlchemy-Utils-0.34.0/CHANGES.rst 2019-06-09 15:01:31.000000000
+0200
@@ -4,6 +4,20 @@
Here you can see the full list of changes between each SQLAlchemy-Utils
release.
+0.34.0 (2019-06-09)
+^^^^^^^^^^^^^^^^^^^
+
+
+- Removed array_agg compilation which was never a good idea and collided with
the latest version of SA. (#374)
+- Removed deprecation warnings (#373, pull request courtesy of pbasista)
+
+
+0.33.12 (2019-02-02)
+^^^^^^^^^^^^^^^^^^^^
+
+- Added ordering support for Country primitive (#361, pull request courtesy of
TrilceAC)
+
+
0.33.11 (2019-01-13)
^^^^^^^^^^^^^^^^^^^^
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SQLAlchemy-Utils-0.33.11/PKG-INFO
new/SQLAlchemy-Utils-0.34.0/PKG-INFO
--- old/SQLAlchemy-Utils-0.33.11/PKG-INFO 2019-01-13 15:21:50.000000000
+0100
+++ new/SQLAlchemy-Utils-0.34.0/PKG-INFO 2019-06-09 15:13:59.000000000
+0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: SQLAlchemy-Utils
-Version: 0.33.11
+Version: 0.34.0
Summary: Various utility functions for SQLAlchemy.
Home-page: https://github.com/kvesteri/sqlalchemy-utils
Author: Konsta Vesterinen, Ryan Leckey, Janne Vanhala, Vesa Uimonen
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/SQLAlchemy-Utils-0.33.11/SQLAlchemy_Utils.egg-info/PKG-INFO
new/SQLAlchemy-Utils-0.34.0/SQLAlchemy_Utils.egg-info/PKG-INFO
--- old/SQLAlchemy-Utils-0.33.11/SQLAlchemy_Utils.egg-info/PKG-INFO
2019-01-13 15:21:49.000000000 +0100
+++ new/SQLAlchemy-Utils-0.34.0/SQLAlchemy_Utils.egg-info/PKG-INFO
2019-06-09 15:13:58.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: SQLAlchemy-Utils
-Version: 0.33.11
+Version: 0.34.0
Summary: Various utility functions for SQLAlchemy.
Home-page: https://github.com/kvesteri/sqlalchemy-utils
Author: Konsta Vesterinen, Ryan Leckey, Janne Vanhala, Vesa Uimonen
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/SQLAlchemy-Utils-0.33.11/SQLAlchemy_Utils.egg-info/SOURCES.txt
new/SQLAlchemy-Utils-0.34.0/SQLAlchemy_Utils.egg-info/SOURCES.txt
--- old/SQLAlchemy-Utils-0.33.11/SQLAlchemy_Utils.egg-info/SOURCES.txt
2019-01-13 15:21:49.000000000 +0100
+++ new/SQLAlchemy-Utils-0.34.0/SQLAlchemy_Utils.egg-info/SOURCES.txt
2019-06-09 15:13:59.000000000 +0200
@@ -33,6 +33,7 @@
docs/range_data_types.rst
docs/testing.rst
docs/utility_classes.rst
+docs/view.rst
sqlalchemy_utils/__init__.py
sqlalchemy_utils/aggregates.py
sqlalchemy_utils/asserts.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/SQLAlchemy-Utils-0.33.11/SQLAlchemy_Utils.egg-info/requires.txt
new/SQLAlchemy-Utils-0.34.0/SQLAlchemy_Utils.egg-info/requires.txt
--- old/SQLAlchemy-Utils-0.33.11/SQLAlchemy_Utils.egg-info/requires.txt
2019-01-13 15:21:49.000000000 +0100
+++ new/SQLAlchemy-Utils-0.34.0/SQLAlchemy_Utils.egg-info/requires.txt
2019-06-09 15:13:58.000000000 +0200
@@ -41,7 +41,7 @@
psycopg2>=2.5.1
pg8000>=1.12.4
pytz>=2014.2
-python-dateutil>=2.2
+python-dateutil>=2.6
pymysql
flake8>=2.4.0
isort>=4.2.2
@@ -67,7 +67,7 @@
psycopg2>=2.5.1
pg8000>=1.12.4
pytz>=2014.2
-python-dateutil>=2.2
+python-dateutil>=2.6
pymysql
flake8>=2.4.0
isort>=4.2.2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SQLAlchemy-Utils-0.33.11/conftest.py
new/SQLAlchemy-Utils-0.34.0/conftest.py
--- old/SQLAlchemy-Utils-0.33.11/conftest.py 2018-12-04 14:36:31.000000000
+0100
+++ new/SQLAlchemy-Utils-0.34.0/conftest.py 2019-06-09 14:59:02.000000000
+0200
@@ -7,6 +7,7 @@
from sqlalchemy.ext.declarative import declarative_base, synonym_for
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.orm import sessionmaker
+from sqlalchemy.orm.session import close_all_sessions
from sqlalchemy_utils import (
aggregates,
coercion_listener,
@@ -54,7 +55,7 @@
@pytest.fixture
def postgresql_dsn(postgresql_db_user, db_name):
- return 'postgres://{0}@localhost/{1}'.format(postgresql_db_user, db_name)
+ return 'postgresql://{0}@localhost/{1}'.format(postgresql_db_user, db_name)
@pytest.fixture
@@ -218,7 +219,7 @@
def teardown():
aggregates.manager.reset()
- session.close_all()
+ close_all_sessions()
Base.metadata.drop_all(connection)
remove_composite_listeners()
connection.close()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SQLAlchemy-Utils-0.33.11/docs/index.rst
new/SQLAlchemy-Utils-0.34.0/docs/index.rst
--- old/SQLAlchemy-Utils-0.33.11/docs/index.rst 2015-08-16 10:02:59.000000000
+0200
+++ new/SQLAlchemy-Utils-0.34.0/docs/index.rst 2019-04-22 10:53:34.000000000
+0200
@@ -21,5 +21,6 @@
orm_helpers
utility_classes
models
+ view
testing
license
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SQLAlchemy-Utils-0.33.11/docs/view.rst
new/SQLAlchemy-Utils-0.34.0/docs/view.rst
--- old/SQLAlchemy-Utils-0.33.11/docs/view.rst 1970-01-01 01:00:00.000000000
+0100
+++ new/SQLAlchemy-Utils-0.34.0/docs/view.rst 2019-04-22 10:53:34.000000000
+0200
@@ -0,0 +1,22 @@
+View utilities
+==============
+
+.. module:: sqlalchemy_utils
+
+
+create_view
+-----------
+
+.. autofunction:: create_view
+
+
+create_materialized_view
+------------------------
+
+.. autofunction:: create_materialized_view
+
+
+refresh_materialized_view
+-------------------------
+
+.. autofunction:: refresh_materialized_view
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SQLAlchemy-Utils-0.33.11/setup.py
new/SQLAlchemy-Utils-0.34.0/setup.py
--- old/SQLAlchemy-Utils-0.33.11/setup.py 2019-01-13 15:14:28.000000000
+0100
+++ new/SQLAlchemy-Utils-0.34.0/setup.py 2019-06-09 14:59:02.000000000
+0200
@@ -33,7 +33,7 @@
'psycopg2>=2.5.1',
'pg8000>=1.12.4',
'pytz>=2014.2',
- 'python-dateutil>=2.2',
+ 'python-dateutil>=2.6',
'pymysql',
'flake8>=2.4.0',
'isort>=4.2.2',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/SQLAlchemy-Utils-0.33.11/sqlalchemy_utils/__init__.py
new/SQLAlchemy-Utils-0.34.0/sqlalchemy_utils/__init__.py
--- old/SQLAlchemy-Utils-0.33.11/sqlalchemy_utils/__init__.py 2019-01-13
15:14:36.000000000 +0100
+++ new/SQLAlchemy-Utils-0.34.0/sqlalchemy_utils/__init__.py 2019-06-09
15:01:52.000000000 +0200
@@ -100,4 +100,4 @@
refresh_materialized_view
)
-__version__ = '0.33.11'
+__version__ = '0.34.0'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/SQLAlchemy-Utils-0.33.11/sqlalchemy_utils/expressions.py
new/SQLAlchemy-Utils-0.34.0/sqlalchemy_utils/expressions.py
--- old/SQLAlchemy-Utils-0.33.11/sqlalchemy_utils/expressions.py
2016-04-25 16:20:06.000000000 +0200
+++ new/SQLAlchemy-Utils-0.34.0/sqlalchemy_utils/expressions.py 2019-06-09
14:58:48.000000000 +0200
@@ -112,27 +112,6 @@
return "%s(%s)" % (element.name, compiler.process(element.clauses))
-class array_agg(GenericFunction):
- name = 'array_agg'
- type = postgresql.ARRAY
-
- def __init__(self, arg, default=None, **kw):
- self.type = postgresql.ARRAY(arg.type)
- self.default = default
- GenericFunction.__init__(self, arg, **kw)
-
-
-@compiles(array_agg, 'postgresql')
-def compile_array_agg(element, compiler, **kw):
- compiled = "%s(%s)" % (element.name, compiler.process(element.clauses))
- if element.default is None:
- return compiled
- return str(sa.func.coalesce(
- sa.text(compiled),
- sa.cast(postgresql.array(element.default), element.type)
- ).compile(compiler))
-
-
class Asterisk(ColumnElement):
def __init__(self, selectable):
self.selectable = selectable
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/SQLAlchemy-Utils-0.33.11/sqlalchemy_utils/functions/database.py
new/SQLAlchemy-Utils-0.34.0/sqlalchemy_utils/functions/database.py
--- old/SQLAlchemy-Utils-0.33.11/sqlalchemy_utils/functions/database.py
2019-01-13 15:14:28.000000000 +0100
+++ new/SQLAlchemy-Utils-0.34.0/sqlalchemy_utils/functions/database.py
2019-06-09 14:59:02.000000000 +0200
@@ -438,13 +438,13 @@
Performs backend-specific testing to quickly determine if a database
exists on the server. ::
- database_exists('postgres://postgres@localhost/name') #=> False
- create_database('postgres://postgres@localhost/name')
- database_exists('postgres://postgres@localhost/name') #=> True
+ database_exists('postgresql://postgres@localhost/name') #=> False
+ create_database('postgresql://postgres@localhost/name')
+ database_exists('postgresql://postgres@localhost/name') #=> True
Supports checking against a constructed URL as well. ::
- engine = create_engine('postgres://postgres@localhost/name')
+ engine = create_engine('postgresql://postgres@localhost/name')
database_exists(engine.url) #=> False
create_database(engine.url)
database_exists(engine.url) #=> True
@@ -523,7 +523,7 @@
To create a database, you can pass a simple URL that would have
been passed to ``create_engine``. ::
- create_database('postgres://postgres@localhost/name')
+ create_database('postgresql://postgres@localhost/name')
You may also pass the url from an existing engine. ::
@@ -598,7 +598,7 @@
Works similar to the :ref:`create_database` method in that both url text
and a constructed url are accepted. ::
- drop_database('postgres://postgres@localhost/name')
+ drop_database('postgresql://postgres@localhost/name')
drop_database(engine.url)
"""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SQLAlchemy-Utils-0.33.11/sqlalchemy_utils/i18n.py
new/SQLAlchemy-Utils-0.34.0/sqlalchemy_utils/i18n.py
--- old/SQLAlchemy-Utils-0.33.11/sqlalchemy_utils/i18n.py 2018-12-27
12:40:51.000000000 +0100
+++ new/SQLAlchemy-Utils-0.34.0/sqlalchemy_utils/i18n.py 2019-02-02
12:03:24.000000000 +0100
@@ -15,11 +15,11 @@
babel = None
-try:
- def get_locale(): return babel.Locale('en')
-except AttributeError:
- # As babel is optional, we may raise an AttributeError accessing it
- def get_locale():
+def get_locale():
+ try:
+ return babel.Locale('en')
+ except AttributeError:
+ # As babel is optional, we may raise an AttributeError accessing it
raise ImproperlyConfigured(
'Could not load get_locale function using Babel. Either '
'install Babel or make a similar function and override it '
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SQLAlchemy-Utils-0.33.11/sqlalchemy_utils/models.py
new/SQLAlchemy-Utils-0.34.0/sqlalchemy_utils/models.py
--- old/SQLAlchemy-Utils-0.33.11/sqlalchemy_utils/models.py 2016-12-18
10:08:56.000000000 +0100
+++ new/SQLAlchemy-Utils-0.34.0/sqlalchemy_utils/models.py 2019-02-02
12:03:24.000000000 +0100
@@ -55,7 +55,7 @@
def generic_repr(*fields):
- """Adds generic ``__repr__()`` method to a decalrative SQLAlchemy model.
+ """Adds generic ``__repr__()`` method to a declarative SQLAlchemy model.
In case if some fields are not loaded from a database, it doesn't
force their loading and instead repesents them as ``<not loaded>``.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/SQLAlchemy-Utils-0.33.11/sqlalchemy_utils/primitives/country.py
new/SQLAlchemy-Utils-0.34.0/sqlalchemy_utils/primitives/country.py
--- old/SQLAlchemy-Utils-0.33.11/sqlalchemy_utils/primitives/country.py
2018-12-27 12:40:51.000000000 +0100
+++ new/SQLAlchemy-Utils-0.34.0/sqlalchemy_utils/primitives/country.py
2019-02-02 12:18:31.000000000 +0100
@@ -1,9 +1,12 @@
+from functools import total_ordering
+
import six
from .. import i18n
from ..utils import str_coercible
+@total_ordering
@str_coercible
class Country(object):
"""
@@ -95,6 +98,13 @@
def __ne__(self, other):
return not (self == other)
+ def __lt__(self, other):
+ if isinstance(other, Country):
+ return self.code < other.code
+ elif isinstance(other, six.string_types):
+ return self.code < other
+ return NotImplemented
+
def __repr__(self):
return '%s(%r)' % (self.__class__.__name__, self.code)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/SQLAlchemy-Utils-0.33.11/sqlalchemy_utils/primitives/ltree.py
new/SQLAlchemy-Utils-0.34.0/sqlalchemy_utils/primitives/ltree.py
--- old/SQLAlchemy-Utils-0.33.11/sqlalchemy_utils/primitives/ltree.py
2018-02-18 15:34:52.000000000 +0100
+++ new/SQLAlchemy-Utils-0.34.0/sqlalchemy_utils/primitives/ltree.py
2019-02-02 12:03:24.000000000 +0100
@@ -36,7 +36,7 @@
::
Ltree.validate('1.2.3')
- Ltree.validate(None) # raises ValueError
+ Ltree.validate(None) # raises TypeError
Ltree supports equality operators.
@@ -59,7 +59,7 @@
::
- assert len(Ltree('1.2')) 2
+ assert len(Ltree('1.2')) == 2
assert len(Ltree('some.one.some.where')) # 4
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/SQLAlchemy-Utils-0.33.11/sqlalchemy_utils/types/ltree.py
new/SQLAlchemy-Utils-0.34.0/sqlalchemy_utils/types/ltree.py
--- old/SQLAlchemy-Utils-0.33.11/sqlalchemy_utils/types/ltree.py
2016-04-29 12:40:31.000000000 +0200
+++ new/SQLAlchemy-Utils-0.34.0/sqlalchemy_utils/types/ltree.py 2019-02-02
12:03:24.000000000 +0100
@@ -18,16 +18,16 @@
::
- from sqlalchemy_utils import LtreeType
+ from sqlalchemy_utils import LtreeType, Ltree
class DocumentSection(Base):
__tablename__ = 'document_section'
- id = sa.Column(sa.Integer, autoincrement=True)
+ id = sa.Column(sa.Integer, autoincrement=True, primary_key=True)
path = sa.Column(LtreeType)
- section = DocumentSection(name='Countries.Finland')
+ section = DocumentSection(path=Ltree('Countries.Finland'))
session.add(section)
session.commit()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/SQLAlchemy-Utils-0.33.11/sqlalchemy_utils/types/timezone.py
new/SQLAlchemy-Utils-0.34.0/sqlalchemy_utils/types/timezone.py
--- old/SQLAlchemy-Utils-0.33.11/sqlalchemy_utils/types/timezone.py
2016-11-19 09:35:59.000000000 +0100
+++ new/SQLAlchemy-Utils-0.34.0/sqlalchemy_utils/types/timezone.py
2019-06-09 14:59:02.000000000 +0200
@@ -38,10 +38,10 @@
if backend == 'dateutil':
try:
from dateutil.tz import tzfile
- from dateutil.zoneinfo import gettz
+ from dateutil.zoneinfo import get_zonefile_instance
self.python_type = tzfile
- self._to = gettz
+ self._to = get_zonefile_instance().zones.get
self._from = lambda x: six.text_type(x._filename)
except ImportError:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SQLAlchemy-Utils-0.33.11/sqlalchemy_utils/view.py
new/SQLAlchemy-Utils-0.34.0/sqlalchemy_utils/view.py
--- old/SQLAlchemy-Utils-0.33.11/sqlalchemy_utils/view.py 2018-10-14
09:07:28.000000000 +0200
+++ new/SQLAlchemy-Utils-0.34.0/sqlalchemy_utils/view.py 2019-04-22
10:53:34.000000000 +0200
@@ -62,6 +62,19 @@
metadata,
indexes=None
):
+ """ Create a view on a given metadata
+
+ :param name: The name of the view to create.
+ :param selectable: An SQLAlchemy selectable e.g. a select() statement.
+ :param metadata:
+ An SQLAlchemy Metadata instance that stores the features of the
+ database being described.
+ :param indexes: An optional list of SQLAlchemy Index instances.
+
+ Same as for ``create_view`` except that a ``CREATE MATERIALIZED VIEW``
+ statement is emitted instead of a ``CREATE VIEW``.
+
+ """
table = create_table_from_selectable(
name=name,
selectable=selectable,
@@ -93,6 +106,36 @@
selectable,
metadata
):
+ """ Create a view on a given metadata
+
+ :param name: The name of the view to create.
+ :param selectable: An SQLAlchemy selectable e.g. a select() statement.
+ :param metadata:
+ An SQLAlchemy Metadata instance that stores the features of the
+ database being described.
+
+ The process for creating a view is similar to the standard way that a
+ table is constructed, except that a selectable is provided instead of
+ a set of columns. The view is created once a ``CREATE`` statement is
+ executed against the supplied metadata (e.g. ``metadata.create_all(..)``),
+ and dropped when a ``DROP`` is executed against the metadata.
+
+ To create a view that performs basic filtering on a table. ::
+
+ metadata = MetaData()
+ users = Table('users', metadata,
+ Column('id', Integer, primary_key=True),
+ Column('name', String),
+ Column('fullname', String),
+ Column('premium_user', Boolean, default=False),
+ )
+
+ premium_members = select([users]).where(users.c.premium_user == True)
+ create_view('premium_users', premium_members, metadata)
+
+ metadata.create_all(engine) # View is created at this point
+
+ """
table = create_table_from_selectable(
name=name,
selectable=selectable,
@@ -111,6 +154,14 @@
def refresh_materialized_view(session, name, concurrently=False):
+ """ Refreshes an already existing materialized view
+
+ :param session: An SQLAlchemy Session instance.
+ :param name: The name of the materialized view to refresh.
+ :param concurrently:
+ Optional flag that causes the ``CONCURRENTLY`` parameter
+ to be specified when the materialized view is refreshed.
+ """
# Since session.execute() bypasses autoflush, we must manually flush in
# order to include newly-created/modified objects in the refresh.
session.flush()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/SQLAlchemy-Utils-0.33.11/tests/functions/test_database.py
new/SQLAlchemy-Utils-0.34.0/tests/functions/test_database.py
--- old/SQLAlchemy-Utils-0.33.11/tests/functions/test_database.py
2019-01-13 15:14:28.000000000 +0100
+++ new/SQLAlchemy-Utils-0.34.0/tests/functions/test_database.py
2019-06-09 14:59:02.000000000 +0200
@@ -27,7 +27,7 @@
assert database_exists(dsn)
[email protected]('sqlite_none_database_dsn')
[email protected]('sqlite_none_database_dsn')
class TestDatabaseSQLiteMemoryNoDatabaseString(object):
def test_exists_memory_none_database(self, sqlite_none_database_dsn):
assert database_exists(sqlite_none_database_dsn)
@@ -75,7 +75,7 @@
"TEMPLATE my_template"
)
)
- dsn = 'postgres://{0}@localhost/db_test_sqlalchemy_util'.format(
+ dsn = 'postgresql://{0}@localhost/db_test_sqlalchemy_util'.format(
postgresql_db_user
)
create_database(dsn, template='my_template')
@@ -108,7 +108,7 @@
'TEMPLATE "my-template"'
)
)
- dsn = 'postgres://{0}@localhost/db_test_sqlalchemy-util'.format(
+ dsn = 'postgresql://{0}@localhost/db_test_sqlalchemy-util'.format(
postgresql_db_user
)
create_database(dsn, template='my-template')
@@ -117,7 +117,7 @@
class TestDatabasePostgresCreateDatabaseCloseConnection(object):
def test_create_database_twice(self, postgresql_db_user):
dsn_list = [
- 'postgres://{0}@localhost/db_test_sqlalchemy-util-a'.format(
+ 'postgresql://{0}@localhost/db_test_sqlalchemy-util-a'.format(
postgresql_db_user
),
'postgres://{0}@localhost/db_test_sqlalchemy-util-b'.format(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/SQLAlchemy-Utils-0.33.11/tests/primitives/test_country.py
new/SQLAlchemy-Utils-0.34.0/tests/primitives/test_country.py
--- old/SQLAlchemy-Utils-0.33.11/tests/primitives/test_country.py
2016-04-25 16:20:07.000000000 +0200
+++ new/SQLAlchemy-Utils-0.34.0/tests/primitives/test_country.py
2019-02-02 12:18:31.000000000 +0100
@@ -1,3 +1,5 @@
+import operator
+
import pytest
import six
@@ -56,6 +58,33 @@
assert Country(u'FI') != u'sv'
assert not (Country(u'FI') != u'FI')
+ @pytest.mark.parametrize(
+ 'op, code_left, code_right, is_',
+ [
+ (operator.lt, u'ES', u'FI', True),
+ (operator.lt, u'FI', u'ES', False),
+ (operator.lt, u'ES', u'ES', False),
+
+ (operator.le, u'ES', u'FI', True),
+ (operator.le, u'FI', u'ES', False),
+ (operator.le, u'ES', u'ES', True),
+
+ (operator.ge, u'ES', u'FI', False),
+ (operator.ge, u'FI', u'ES', True),
+ (operator.ge, u'ES', u'ES', True),
+
+ (operator.gt, u'ES', u'FI', False),
+ (operator.gt, u'FI', u'ES', True),
+ (operator.gt, u'ES', u'ES', False),
+ ]
+ )
+ def test_ordering(self, op, code_left, code_right, is_):
+ country_left = Country(code_left)
+ country_right = Country(code_right)
+ assert op(country_left, country_right) is is_
+ assert op(country_left, code_right) is is_
+ assert op(code_left, country_right) is is_
+
def test_hash(self):
return hash(Country('FI')) == hash('FI')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/SQLAlchemy-Utils-0.33.11/tests/test_expressions.py
new/SQLAlchemy-Utils-0.34.0/tests/test_expressions.py
--- old/SQLAlchemy-Utils-0.33.11/tests/test_expressions.py 2016-10-20
09:52:40.000000000 +0200
+++ new/SQLAlchemy-Utils-0.34.0/tests/test_expressions.py 2019-06-09
14:58:44.000000000 +0200
@@ -49,37 +49,45 @@
def test_with_string_as_stmt_param(self, assert_startswith):
assert_startswith(
- explain('SELECT 1 FROM article'),
+ explain(sa.text('SELECT 1 FROM article')),
'EXPLAIN SELECT'
)
def test_format(self, assert_startswith):
assert_startswith(
- explain('SELECT 1 FROM article', format='json'),
+ explain(sa.text('SELECT 1 FROM article'), format='json'),
'EXPLAIN (FORMAT json) SELECT'
)
def test_timing(self, assert_startswith):
assert_startswith(
- explain('SELECT 1 FROM article', analyze=True, timing=False),
+ explain(
+ sa.text('SELECT 1 FROM article'),
+ analyze=True,
+ timing=False
+ ),
'EXPLAIN (ANALYZE true, TIMING false) SELECT'
)
def test_verbose(self, assert_startswith):
assert_startswith(
- explain('SELECT 1 FROM article', verbose=True),
+ explain(sa.text('SELECT 1 FROM article'), verbose=True),
'EXPLAIN (VERBOSE true) SELECT'
)
def test_buffers(self, assert_startswith):
assert_startswith(
- explain('SELECT 1 FROM article', analyze=True, buffers=True),
+ explain(
+ sa.text('SELECT 1 FROM article'),
+ analyze=True,
+ buffers=True
+ ),
'EXPLAIN (ANALYZE true, BUFFERS true) SELECT'
)
def test_costs(self, assert_startswith):
assert_startswith(
- explain('SELECT 1 FROM article', costs=False),
+ explain(sa.text('SELECT 1 FROM article'), costs=False),
'EXPLAIN (COSTS false) SELECT'
)
@@ -132,35 +140,3 @@
sa.func.row_to_json(sa.text('article.*')).type,
postgresql.JSON
)
-
-
-class TestArrayAgg(object):
- def test_compiler_with_default_dialect(self):
- assert str(sa.func.array_agg(sa.text('u.name'))) == (
- 'array_agg(u.name)'
- )
-
- def test_compiler_with_postgresql(self):
- assert str(sa.func.array_agg(sa.text('u.name')).compile(
- dialect=postgresql.dialect()
- )) == 'array_agg(u.name)'
-
- def test_type(self):
- assert isinstance(
- sa.func.array_agg(sa.text('u.name')).type,
- postgresql.ARRAY
- )
-
- def test_array_agg_with_default(self):
- Base = sa.ext.declarative.declarative_base()
-
- class Article(Base):
- __tablename__ = 'article'
- id = sa.Column(sa.Integer, primary_key=True)
-
- assert str(sa.func.array_agg(Article.id, [1]).compile(
- dialect=postgresql.dialect()
- )) == (
- 'coalesce(array_agg(article.id), CAST(ARRAY[%(param_1)s]'
- ' AS INTEGER[]))'
- )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/SQLAlchemy-Utils-0.33.11/tests/test_translation_hybrid.py
new/SQLAlchemy-Utils-0.34.0/tests/test_translation_hybrid.py
--- old/SQLAlchemy-Utils-0.33.11/tests/test_translation_hybrid.py
2018-09-20 09:34:12.000000000 +0200
+++ new/SQLAlchemy-Utils-0.34.0/tests/test_translation_hybrid.py
2019-02-02 12:04:26.000000000 +0100
@@ -43,7 +43,7 @@
def test_custom_default_value(self, City, translation_hybrid):
translation_hybrid.default_value = 'Some value'
city = City()
- assert city.name is 'Some value'
+ assert city.name == 'Some value'
def test_fall_back_to_default_translation(self, City, translation_hybrid):
city = City(name_translations={'en': 'Helsinki'})