Skip to content

Commit 315ed95

Browse files
committed
Fix python formatter
1 parent 2541fc7 commit 315ed95

1 file changed

Lines changed: 19 additions & 22 deletions

File tree

sdks/python/apache_beam/yaml/integration_tests.py

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import copy
2222
import glob
2323
import itertools
24-
import json
2524
import logging
2625
import os
2726
import random
@@ -39,11 +38,9 @@
3938

4039
import mock
4140
import requests
42-
from testcontainers.core.container import DockerContainer
4341

4442
from apache_beam.coders import Coder
4543
from apache_beam.coders.coder_impl import CoderImpl
46-
from apache_beam.yaml.test_utils.datadog_test_utils import temp_fake_datadog_server
4744

4845

4946
class BigEndianIntegerCoderImpl(CoderImpl):
@@ -399,11 +396,10 @@ def temp_debezium_postgres_database():
399396
"""Provides a temporary PostgreSQL database configured for Debezium CDC."""
400397

401398
container = (
402-
DockerContainer('quay.io/debezium/example-postgres:latest')
403-
.with_env('POSTGRES_USER', 'debezium')
404-
.with_env('POSTGRES_PASSWORD', 'dbz')
405-
.with_env('POSTGRES_DB', 'inventory')
406-
.with_exposed_ports(5432))
399+
DockerContainer('quay.io/debezium/example-postgres:latest').with_env(
400+
'POSTGRES_USER',
401+
'debezium').with_env('POSTGRES_PASSWORD', 'dbz').with_env(
402+
'POSTGRES_DB', 'inventory').with_exposed_ports(5432))
407403

408404
try:
409405
container.start()
@@ -416,29 +412,30 @@ def temp_debezium_postgres_database():
416412
for _ in range(30):
417413
try:
418414
connection = psycopg2.connect(
419-
host=host,
420-
port=port,
421-
user='debezium',
422-
password='dbz',
423-
dbname='inventory')
415+
host=host,
416+
port=port,
417+
user='debezium',
418+
password='dbz',
419+
dbname='inventory')
424420
break
425421
except psycopg2.OperationalError:
426422
time.sleep(1)
427423

428424
if connection is None:
429-
raise RuntimeError('Debezium PostgreSQL container failed to become ready.')
425+
raise RuntimeError(
426+
'Debezium PostgreSQL container failed to become ready.')
430427

431428
try:
432429
with connection.cursor() as cursor:
433430
cursor.execute(
434-
"""
431+
"""
435432
CREATE TABLE IF NOT EXISTS customers (
436433
id INTEGER PRIMARY KEY,
437434
name VARCHAR(255)
438435
)
439436
""")
440437
cursor.execute(
441-
"""
438+
"""
442439
INSERT INTO customers (id, name)
443440
VALUES
444441
(1, 'Alice'),
@@ -450,12 +447,12 @@ def temp_debezium_postgres_database():
450447
connection.close()
451448

452449
yield {
453-
'HOST': host,
454-
'PORT': port,
455-
'USERNAME': 'debezium',
456-
'PASSWORD': 'dbz',
457-
'DATABASE': 'inventory',
458-
'TABLE': 'public.customers',
450+
'HOST': host,
451+
'PORT': port,
452+
'USERNAME': 'debezium',
453+
'PASSWORD': 'dbz',
454+
'DATABASE': 'inventory',
455+
'TABLE': 'public.customers',
459456
}
460457

461458
finally:

0 commit comments

Comments
 (0)