8000 Formating. · python-bonobo/bonobo-sqlalchemy@5e1bbd9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5e1bbd9

Browse files
committed
Formating.
1 parent fa7ea30 commit 5e1bbd9

File tree

5 files changed

+13
-16
lines changed

5 files changed

+13
-16
lines changed

bonobo_sqlalchemy/writers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class InsertOrUpdate(Configurable):
2323
table_name = Option(str, positional=True) # type: str
2424
fetch_columns = Option(tuple, required=False, default=()) # type: tuple
2525
insert_only_fields = Option(tuple, required=False, default=()) # type: tuple
26-
discriminant = Option(tuple, required=False, default=('id',)) # type: tuple
26+
discriminant = Option(tuple, required=False, default=('id', )) # type: tuple
2727
created_at_field = Option(str, required=False, default='created_at') # type: str
2828
updated_at_field = Option(str, required=False, default='updated_at') # type: str
2929
allowed_operations = Option(

examples/commands.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,16 @@ def parse_args(parser=None):
4141

4242
if options['create']:
4343
# create database/role with super user privileges
44-
_execute_sql(root_engine, 'CREATE ROLE {} WITH LOGIN PASSWORD \'{}\';'.format(
45-
settings.DATABASE_USERNAME, settings.DATABASE_PASSWORD
46-
))
47-
_execute_sql(root_engine,
48-
'CREATE DATABASE {} WITH OWNER={} TEMPLATE=template0 ENCODING="utf-8";'.format(
49-
settings.DATABASE_NAME, settings.DATABASE_USERNAME
50-
))
44+
_execute_sql(
45+
root_engine, 'CREATE ROLE {} WITH LOGIN PASSWORD \'{}\';'.format(
46+
settings.DATABASE_USERNAME, settings.DATABASE_PASSWORD
47+
)
48+
)
49+
_execute_sql(
50+
root_engine, 'CREATE DATABASE {} WITH OWNER={} TEMPLATE=template0 ENCODING="utf-8";'.format(
51+
settings.DATABASE_NAME, settings.DATABASE_USERNAME
52+
)
53+
)
5154

5255
# create tables in userland
5356
engine = services.create_engine()

examples/sequel_load.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ def extract(context):
1515

1616
def get_graph(**options):
1717
graph = bonobo.Graph()
18-
graph.add_chain(
19-
extract,
20-
bonobo_sqlalchemy.InsertOrUpdate('example')
21-
)
18+
graph.add_chain(extract, bonobo_sqlalchemy.InsertOrUpdate('example'))
2219

2320
return graph
2421

examples/services.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,4 @@ def create_engine(superuser=False):
1818

1919

2020
def get_services():
21-
return {
22-
'sqlalchemy.engine': create_engine()
23-
}
21+
return {'sqlalchemy.engine': create_engine()}

examples/settings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
DATABASE_TYPE = 'postgres'
32

43
DATABASE_NAME = 'example'

0 commit comments

Comments
 (0)
0