Skip to content

Commit b1a1db0

Browse files
authored
Run updated black (#2644)
1 parent 645a9a0 commit b1a1db0

9 files changed

Lines changed: 23 additions & 34 deletions

File tree

elasticapm/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
)
5050
from elasticapm.utils.disttracing import trace_parent_from_headers, trace_parent_from_string # noqa: F401
5151

52-
5352
_activation_method = None
5453

5554
try:

elasticapm/contrib/serverless/aws.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,9 +469,11 @@ def send_partial_transaction(self) -> None:
469469
data = transport._json_serializer({"metadata": self.client.build_metadata()}) + "\n"
470470
data += transport._json_serializer({"transaction": transaction.to_dict()})
471471
partial_transaction_url = urllib.parse.urljoin(
472-
self.client.config.server_url
473-
if self.client.config.server_url.endswith("/")
474-
else self.client.config.server_url + "/",
472+
(
473+
self.client.config.server_url
474+
if self.client.config.server_url.endswith("/")
475+
else self.client.config.server_url + "/"
476+
),
475477
"register/transaction",
476478
)
477479
try:

elasticapm/contrib/tornado/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
instrumentation. This module only creates the client for later use by the
3535
that instrumentation, and triggers the global instrumentation itself.
3636
"""
37+
3738
import tornado
3839

3940
import elasticapm

elasticapm/instrumentation/packages/tornado.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"""
3131
Instrumentation for Tornado
3232
"""
33+
3334
import elasticapm
3435
from elasticapm.conf import constants
3536
from elasticapm.instrumentation.packages.asyncio.base import AbstractInstrumentedModule, AsyncAbstractInstrumentedModule

elasticapm/metrics/sets/prometheus.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,18 @@ def _prom_counter_handler(self, name, samples, unit) -> None:
5454
# given name. The pair consists of the value, and a "created" timestamp.
5555
# We only use the former.
5656
for total_sample, _ in grouper(samples, 2):
57-
self.counter(
58-
self._registry.client.config.prometheus_metrics_prefix + name, **total_sample.labels
59-
).val = total_sample.value
57+
self.counter(self._registry.client.config.prometheus_metrics_prefix + name, **total_sample.labels).val = (
58+
total_sample.value
59+
)
6060

6161
def _prom_gauge_handler(self, name, samples, unit) -> None:
6262
# Counters can be converted 1:1 from Prometheus to our
6363
# format. Each sample represents a distinct labelset for a
6464
# given name
6565
for sample in samples:
66-
self.gauge(
67-
self._registry.client.config.prometheus_metrics_prefix + name, **sample.labels
68-
).val = sample.value
66+
self.gauge(self._registry.client.config.prometheus_metrics_prefix + name, **sample.labels).val = (
67+
sample.value
68+
)
6969

7070
def _prom_summary_handler(self, name, samples, unit) -> None:
7171
# Prometheus Summaries are analogous to our Timers, having

tests/contrib/asyncio/starlette_tests.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232

3333
import pytest # isort:skip
3434

35-
3635
starlette = pytest.importorskip("starlette") # isort:skip
3736

3837
import os

tests/instrumentation/asyncio_tests/aiopg_tests.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,14 @@ async def test_composable_queries(instrument, cursor, elasticapm_client):
119119

120120

121121
async def test_callproc(instrument, cursor, elasticapm_client):
122-
await cursor.execute(
123-
"""
122+
await cursor.execute("""
124123
CREATE OR REPLACE FUNCTION squareme(me INT)
125124
RETURNS INTEGER
126125
LANGUAGE SQL
127126
AS $$
128127
SELECT me*me;
129128
$$;
130-
"""
131-
)
129+
""")
132130
elasticapm_client.begin_transaction("test")
133131
await cursor.callproc("squareme", [2])
134132
result = await cursor.fetchall()

tests/instrumentation/cassandra_tests.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,10 @@ def cassandra_session(cassandra_cluster):
6363
session.execute("DROP KEYSPACE testkeyspace;")
6464
except ConfigurationException:
6565
pass
66-
session.execute(
67-
"""
66+
session.execute("""
6867
CREATE KEYSPACE testkeyspace
6968
WITH REPLICATION = { 'class' : 'SimpleStrategy' ,'replication_factor' : 1 }
70-
"""
71-
)
69+
""")
7270
session.execute("USE testkeyspace;")
7371
session.execute("CREATE TABLE testkeyspace.users ( id UUID PRIMARY KEY, name text);")
7472
yield session
@@ -98,12 +96,10 @@ def test_cassandra_connect(instrument, elasticapm_client, cassandra_cluster):
9896
def test_cassandra_connect_keyspace(instrument, elasticapm_client, cassandra_cluster):
9997
session = cassandra_cluster.connect()
10098
try:
101-
session.execute(
102-
"""
99+
session.execute("""
103100
CREATE KEYSPACE testkeyspace
104101
WITH REPLICATION = { 'class' : 'SimpleStrategy' ,'replication_factor' : 1 }
105-
"""
106-
)
102+
""")
107103
elasticapm_client.begin_transaction("transaction.test")
108104
sess = cassandra_cluster.connect("testkeyspace")
109105
elasticapm_client.end_transaction("test")
@@ -185,19 +181,14 @@ def test_signature_create_keyspace():
185181

186182

187183
def test_signature_create_columnfamily():
188-
assert (
189-
extract_signature(
190-
"""CREATE COLUMNFAMILY users (
184+
assert extract_signature("""CREATE COLUMNFAMILY users (
191185
userid text PRIMARY KEY,
192186
first_name text,
193187
last_name text,
194188
emails set<text>,
195189
top_scores list<int>,
196190
todo map<timestamp, text>
197-
);"""
198-
)
199-
== "CREATE COLUMNFAMILY"
200-
)
191+
);""") == "CREATE COLUMNFAMILY"
201192

202193

203194
def test_select_from_collection():

tests/instrumentation/psycopg2_tests.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -447,16 +447,14 @@ def test_psycopg2_composable_query_works(instrument, postgres_connection, elasti
447447
@pytest.mark.skipif(not has_postgres_configured, reason="PostgresSQL not configured")
448448
def test_psycopg2_call_stored_procedure(instrument, postgres_connection, elasticapm_client):
449449
cursor = postgres_connection.cursor()
450-
cursor.execute(
451-
"""
450+
cursor.execute("""
452451
CREATE OR REPLACE FUNCTION squareme(me INT)
453452
RETURNS INTEGER
454453
LANGUAGE SQL
455454
AS $$
456455
SELECT me*me;
457456
$$;
458-
"""
459-
)
457+
""")
460458
elasticapm_client.begin_transaction("test")
461459
cursor.callproc("squareme", [2])
462460
result = cursor.fetchall()

0 commit comments

Comments
 (0)