Skip to content

Commit 15efb09

Browse files
committed
remove unnecessary indentation
1 parent 491eead commit 15efb09

8 files changed

Lines changed: 201 additions & 201 deletions

File tree

cassandra/cluster.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,10 @@ class ExecutionProfile(object):
230230
231231
Some example implementations:
232232
233-
- :func:`cassandra.query.tuple_factory` - return a result row as a tuple
234-
- :func:`cassandra.query.named_tuple_factory` - return a result row as a named tuple
235-
- :func:`cassandra.query.dict_factory` - return a result row as a dict
236-
- :func:`cassandra.query.ordered_dict_factory` - return a result row as an OrderedDict
233+
- :func:`cassandra.query.tuple_factory` - return a result row as a tuple
234+
- :func:`cassandra.query.named_tuple_factory` - return a result row as a named tuple
235+
- :func:`cassandra.query.dict_factory` - return a result row as a dict
236+
- :func:`cassandra.query.ordered_dict_factory` - return a result row as an OrderedDict
237237
"""
238238

239239
speculative_execution_policy = None
@@ -1897,10 +1897,10 @@ def row_factory(self):
18971897
returned row will be a named tuple. You can alternatively
18981898
use any of the following:
18991899
1900-
- :func:`cassandra.query.tuple_factory` - return a result row as a tuple
1901-
- :func:`cassandra.query.named_tuple_factory` - return a result row as a named tuple
1902-
- :func:`cassandra.query.dict_factory` - return a result row as a dict
1903-
- :func:`cassandra.query.ordered_dict_factory` - return a result row as an OrderedDict
1900+
- :func:`cassandra.query.tuple_factory` - return a result row as a tuple
1901+
- :func:`cassandra.query.named_tuple_factory` - return a result row as a named tuple
1902+
- :func:`cassandra.query.dict_factory` - return a result row as a dict
1903+
- :func:`cassandra.query.ordered_dict_factory` - return a result row as an OrderedDict
19041904
19051905
"""
19061906
return self._row_factory

cassandra/metrics.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@ class Metrics(object):
3737
A :class:`greplin.scales.PmfStat` timer for requests. This is a dict-like
3838
object with the following keys:
3939
40-
* count - number of requests that have been timed
41-
* min - min latency
42-
* max - max latency
43-
* mean - mean latency
44-
* stddev - standard deviation for latencies
45-
* median - median latency
46-
* 75percentile - 75th percentile latencies
47-
* 95percentile - 95th percentile latencies
48-
* 98percentile - 98th percentile latencies
49-
* 99percentile - 99th percentile latencies
50-
* 999percentile - 99.9th percentile latencies
40+
* count - number of requests that have been timed
41+
* min - min latency
42+
* max - max latency
43+
* mean - mean latency
44+
* stddev - standard deviation for latencies
45+
* median - median latency
46+
* 75percentile - 75th percentile latencies
47+
* 95percentile - 95th percentile latencies
48+
* 98percentile - 98th percentile latencies
49+
* 99percentile - 99th percentile latencies
50+
* 999percentile - 99.9th percentile latencies
5151
"""
5252

5353
connection_errors = None

cassandra/util.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -883,9 +883,9 @@ def __init__(self, value):
883883
"""
884884
Initializer value can be:
885885
886-
- integer_type: absolute nanoseconds in the day
887-
- datetime.time: built-in time
888-
- string_type: a string time of the form "HH:MM:SS[.mmmuuunnn]"
886+
- integer_type: absolute nanoseconds in the day
887+
- datetime.time: built-in time
888+
- string_type: a string time of the form "HH:MM:SS[.mmmuuunnn]"
889889
"""
890890
if isinstance(value, six.integer_types):
891891
self._from_timestamp(value)
@@ -1012,9 +1012,9 @@ def __init__(self, value):
10121012
"""
10131013
Initializer value can be:
10141014
1015-
- integer_type: absolute days from epoch (1970, 1, 1). Can be negative.
1016-
- datetime.date: built-in date
1017-
- string_type: a string time of the form "yyyy-mm-dd"
1015+
- integer_type: absolute days from epoch (1970, 1, 1). Can be negative.
1016+
- datetime.date: built-in date
1017+
- string_type: a string time of the form "yyyy-mm-dd"
10181018
"""
10191019
if isinstance(value, six.integer_types):
10201020
self.days_from_epoch = value

docs/api/cassandra/cqlengine/columns.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
Columns
77
-------
88

9-
Columns in your models map to columns in your CQL table. You define CQL columns by defining column attributes on your model classes.
10-
For a model to be valid it needs at least one primary key column and one non-primary key column.
9+
Columns in your models map to columns in your CQL table. You define CQL columns by defining column attributes on your model classes.
10+
For a model to be valid it needs at least one primary key column and one non-primary key column.
1111

12-
Just as in CQL, the order you define your columns in is important, and is the same order they are defined in on a model's corresponding table.
12+
Just as in CQL, the order you define your columns in is important, and is the same order they are defined in on a model's corresponding table.
1313

14-
Each column on your model definitions needs to be an instance of a Column class.
14+
Each column on your model definitions needs to be an instance of a Column class.
1515

1616
.. autoclass:: Column(**kwargs)
1717

docs/cqlengine/batches.rst

Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -8,101 +8,101 @@ cqlengine supports batch queries using the BatchQuery class. Batch queries can b
88
Batch Query General Use Pattern
99
===============================
1010

11-
You can only create, update, and delete rows with a batch query, attempting to read rows out of the database with a batch query will fail.
11+
You can only create, update, and delete rows with a batch query, attempting to read rows out of the database with a batch query will fail.
1212

13-
.. code-block:: python
13+
.. code-block:: python
1414
15-
from cassandra.cqlengine.query import BatchQuery
15+
from cassandra.cqlengine.query import BatchQuery
1616
17-
#using a context manager
18-
with BatchQuery() as b:
19-
now = datetime.now()
20-
em1 = ExampleModel.batch(b).create(example_type=0, description="1", created_at=now)
21-
em2 = ExampleModel.batch(b).create(example_type=0, description="2", created_at=now)
22-
em3 = ExampleModel.batch(b).create(example_type=0, description="3", created_at=now)
23-
24-
# -- or --
25-
26-
#manually
27-
b = BatchQuery()
17+
#using a context manager
18+
with BatchQuery() as b:
2819
now = datetime.now()
2920
em1 = ExampleModel.batch(b).create(example_type=0, description="1", created_at=now)
3021
em2 = ExampleModel.batch(b).create(example_type=0, description="2", created_at=now)
3122
em3 = ExampleModel.batch(b).create(example_type=0, description="3", created_at=now)
32-
b.execute()
3323
34-
# updating in a batch
24+
# -- or --
25+
26+
#manually
27+
b = BatchQuery()
28+
now = datetime.now()
29+
em1 = ExampleModel.batch(b).create(example_type=0, description="1", created_at=now)
30+
em2 = ExampleModel.batch(b).create(example_type=0, description="2", created_at=now)
31+
em3 = ExampleModel.batch(b).create(example_type=0, description="3", created_at=now)
32+
b.execute()
33+
34+
# updating in a batch
3535
36-
b = BatchQuery()
37-
em1.description = "new description"
38-
em1.batch(b).save()
39-
em2.description = "another new description"
40-
em2.batch(b).save()
41-
b.execute()
36+
b = BatchQuery()
37+
em1.description = "new description"
38+
em1.batch(b).save()
39+
em2.description = "another new description"
40+
em2.batch(b).save()
41+
b.execute()
4242
43-
# deleting in a batch
44-
b = BatchQuery()
45-
ExampleModel.objects(id=some_id).batch(b).delete()
46-
ExampleModel.objects(id=some_id2).batch(b).delete()
47-
b.execute()
43+
# deleting in a batch
44+
b = BatchQuery()
45+
ExampleModel.objects(id=some_id).batch(b).delete()
46+
ExampleModel.objects(id=some_id2).batch(b).delete()
47+
b.execute()
4848
4949
50-
Typically you will not want the block to execute if an exception occurs inside the `with` block. However, in the case that this is desirable, it's achievable by using the following syntax:
50+
Typically you will not want the block to execute if an exception occurs inside the `with` block. However, in the case that this is desirable, it's achievable by using the following syntax:
5151

52-
.. code-block:: python
52+
.. code-block:: python
5353
54-
with BatchQuery(execute_on_exception=True) as b:
55-
LogEntry.batch(b).create(k=1, v=1)
56-
mystery_function() # exception thrown in here
57-
LogEntry.batch(b).create(k=1, v=2) # this code is never reached due to the exception, but anything leading up to here will execute in the batch.
54+
with BatchQuery(execute_on_exception=True) as b:
55+
LogEntry.batch(b).create(k=1, v=1)
56+
mystery_function() # exception thrown in here
57+
LogEntry.batch(b).create(k=1, v=2) # this code is never reached due to the exception, but anything leading up to here will execute in the batch.
5858
59-
If an exception is thrown somewhere in the block, any statements that have been added to the batch will still be executed. This is useful for some logging situations.
59+
If an exception is thrown somewhere in the block, any statements that have been added to the batch will still be executed. This is useful for some logging situations.
6060

6161
Batch Query Execution Callbacks
6262
===============================
6363

64-
In order to allow secondary tasks to be chained to the end of batch, BatchQuery instances allow callbacks to be
65-
registered with the batch, to be executed immediately after the batch executes.
64+
In order to allow secondary tasks to be chained to the end of batch, BatchQuery instances allow callbacks to be
65+
registered with the batch, to be executed immediately after the batch executes.
6666

67-
Multiple callbacks can be attached to same BatchQuery instance, they are executed in the same order that they
68-
are added to the batch.
67+
Multiple callbacks can be attached to same BatchQuery instance, they are executed in the same order that they
68+
are added to the batch.
6969

70-
The callbacks attached to a given batch instance are executed only if the batch executes. If the batch is used as a
71-
context manager and an exception is raised, the queued up callbacks will not be run.
70+
The callbacks attached to a given batch instance are executed only if the batch executes. If the batch is used as a
71+
context manager and an exception is raised, the queued up callbacks will not be run.
7272

73-
.. code-block:: python
73+
.. code-block:: python
7474
75-
def my_callback(*args, **kwargs):
76-
pass
75+
def my_callback(*args, **kwargs):
76+
pass
7777
78-
batch = BatchQuery()
78+
batch = BatchQuery()
7979
80-
batch.add_callback(my_callback)
81-
batch.add_callback(my_callback, 'positional arg', named_arg='named arg value')
80+
batch.add_callback(my_callback)
81+
batch.add_callback(my_callback, 'positional arg', named_arg='named arg value')
8282
83-
# if you need reference to the batch within the callback,
84-
# just trap it in the arguments to be passed to the callback:
85-
batch.add_callback(my_callback, cqlengine_batch=batch)
83+
# if you need reference to the batch within the callback,
84+
# just trap it in the arguments to be passed to the callback:
85+
batch.add_callback(my_callback, cqlengine_batch=batch)
8686
87-
# once the batch executes...
88-
batch.execute()
87+
# once the batch executes...
88+
batch.execute()
8989
90-
# the effect of the above scheduled callbacks will be similar to
91-
my_callback()
92-
my_callback('positional arg', named_arg='named arg value')
93-
my_callback(cqlengine_batch=batch)
90+
# the effect of the above scheduled callbacks will be similar to
91+
my_callback()
92+
my_callback('positional arg', named_arg='named arg value')
93+
my_callback(cqlengine_batch=batch)
9494
95-
Failure in any of the callbacks does not affect the batch's execution, as the callbacks are started after the execution
96-
of the batch is complete.
95+
Failure in any of the callbacks does not affect the batch's execution, as the callbacks are started after the execution
96+
of the batch is complete.
9797

9898
Logged vs Unlogged Batches
9999
---------------------------
100-
By default, queries in cqlengine are LOGGED, which carries additional overhead from UNLOGGED. To explicitly state which batch type to use, simply:
100+
By default, queries in cqlengine are LOGGED, which carries additional overhead from UNLOGGED. To explicitly state which batch type to use, simply:
101101

102102

103-
.. code-block:: python
103+
.. code-block:: python
104104
105-
from cassandra.cqlengine.query import BatchType
106-
with BatchQuery(batch_type=BatchType.Unlogged) as b:
107-
LogEntry.batch(b).create(k=1, v=1)
108-
LogEntry.batch(b).create(k=1, v=2)
105+
from cassandra.cqlengine.query import BatchType
106+
with BatchQuery(batch_type=BatchType.Unlogged) as b:
107+
LogEntry.batch(b).create(k=1, v=1)
108+
LogEntry.batch(b).create(k=1, v=2)

0 commit comments

Comments
 (0)