summaryrefslogtreecommitdiff
path: root/examples/sharding
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2019-01-06 01:19:47 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2019-01-06 18:23:11 -0500
commit1e278de4cc9a4181e0747640a960e80efcea1ca9 (patch)
tree13d0c035807613bfa07e734acad79b9c843cb8b0 /examples/sharding
parent1e1a38e7801f410f244e4bbb44ec795ae152e04e (diff)
downloadsqlalchemy-1e278de4cc9a4181e0747640a960e80efcea1ca9.tar.gz
Post black reformatting
Applied on top of a pure run of black -l 79 in I7eda77fed3d8e73df84b3651fd6cfcfe858d4dc9, this set of changes resolves all remaining flake8 conditions for those codes we have enabled in setup.cfg. Included are resolutions for all remaining flake8 issues including shadowed builtins, long lines, import order, unused imports, duplicate imports, and docstring issues. Change-Id: I4f72d3ba1380dd601610ff80b8fb06a2aff8b0fe
Diffstat (limited to 'examples/sharding')
-rw-r--r--examples/sharding/__init__.py2
-rw-r--r--examples/sharding/attribute_shard.py31
2 files changed, 17 insertions, 16 deletions
diff --git a/examples/sharding/__init__.py b/examples/sharding/__init__.py
index 59d26a217..eb8e10686 100644
--- a/examples/sharding/__init__.py
+++ b/examples/sharding/__init__.py
@@ -8,7 +8,7 @@ The basic components of a "sharded" mapping are:
* a function which can return a single shard id, given an instance
to be saved; this is called "shard_chooser"
* a function which can return a list of shard ids which apply to a particular
- instance identifier; this is called "id_chooser". If it returns all shard ids,
+ instance identifier; this is called "id_chooser".If it returns all shard ids,
all shards will be searched.
* a function which can return a list of shard ids to try, given a particular
Query ("query_chooser"). If it returns all shard ids, all shards will be
diff --git a/examples/sharding/attribute_shard.py b/examples/sharding/attribute_shard.py
index 48a3dc932..608f0f9c3 100644
--- a/examples/sharding/attribute_shard.py
+++ b/examples/sharding/attribute_shard.py
@@ -1,20 +1,21 @@
-from sqlalchemy import (
- create_engine,
- Table,
- Column,
- Integer,
- String,
- ForeignKey,
- Float,
- DateTime,
-)
-from sqlalchemy.orm import sessionmaker, relationship
-from sqlalchemy.ext.horizontal_shard import ShardedSession
-from sqlalchemy.sql import operators, visitors
-from sqlalchemy.ext.declarative import declarative_base
+import datetime
+
+from sqlalchemy import Column
+from sqlalchemy import create_engine
+from sqlalchemy import DateTime
+from sqlalchemy import Float
+from sqlalchemy import ForeignKey
from sqlalchemy import inspect
+from sqlalchemy import Integer
+from sqlalchemy import String
+from sqlalchemy import Table
+from sqlalchemy.ext.declarative import declarative_base
+from sqlalchemy.ext.horizontal_shard import ShardedSession
+from sqlalchemy.orm import relationship
+from sqlalchemy.orm import sessionmaker
+from sqlalchemy.sql import operators
+from sqlalchemy.sql import visitors
-import datetime
# db1 is used for id generation. The "pool_threadlocal"
# causes the id_generator() to use the same connection as that