Skip to content

Commit 1695e8b

Browse files
committed
auto-fix format issues
1 parent 2ec39d7 commit 1695e8b

File tree

3 files changed

+33
-26
lines changed

3 files changed

+33
-26
lines changed

airbyte_cdk/utils/connector_paths.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,12 @@ def _find_in_adjacent_dirs(current_dir: Path) -> Path | None:
5151
return parent_dir / "airbyte-enterprise"
5252

5353
# Check children only if no "airbyte" or "airbyte-enterprise" in parent
54-
if not any([
55-
"airbyte" in current_dir.parts,
56-
"airbyte-enterprise" in current_dir.parts,
57-
]):
54+
if not any(
55+
[
56+
"airbyte" in current_dir.parts,
57+
"airbyte-enterprise" in current_dir.parts,
58+
]
59+
):
5860
if _is_airbyte_repo_root(current_dir / "airbyte"):
5961
return current_dir / "airbyte"
6062
if _is_airbyte_repo_root(current_dir / "airbyte-enterprise"):

airbyte_cdk/utils/docker.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ class ConnectorImageBuildError(Exception):
2626
build_args: list[str]
2727

2828
def __str__(self) -> str:
29-
return "\n".join([
30-
f"ConnectorImageBuildError: Could not build image.",
31-
f"Build args: {self.build_args}",
32-
f"Error text: {self.error_text}",
33-
])
29+
return "\n".join(
30+
[
31+
f"ConnectorImageBuildError: Could not build image.",
32+
f"Build args: {self.build_args}",
33+
f"Error text: {self.error_text}",
34+
]
35+
)
3436

3537

3638
logger = logging.getLogger(__name__)
@@ -75,11 +77,13 @@ def _build_image(
7577
docker_args.append(f"--build-arg={key}={value}")
7678
else:
7779
docker_args.append(f"--build-arg={key}")
78-
docker_args.extend([
79-
"-t",
80-
tag,
81-
str(context_dir),
82-
])
80+
docker_args.extend(
81+
[
82+
"-t",
83+
tag,
84+
str(context_dir),
85+
]
86+
)
8387

8488
print(f"Building image: {tag} ({arch})")
8589
try:

unit_tests/cli/airbyte_cdk/test_util.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,30 @@
77

88
CDK_REPO_ROOT = Path(__file__).resolve().parents[3].absolute()
99

10+
1011
def check_local_repo_structure() -> bool:
1112
"""
1213
Check if the local repository structure is correct.
1314
This function checks if the current working directory is 'airbyte-cdk'.
1415
"""
15-
return all([
16-
CDK_REPO_ROOT.name == "airbyte-python-cdk",
17-
(CDK_REPO_ROOT.parent / "airbyte").is_dir(),
18-
(CDK_REPO_ROOT.parent / "airbyte-enterprise").is_dir(),
19-
(CDK_REPO_ROOT.parent / "airbyte" / "airbyte-integrations").is_dir(),
20-
(CDK_REPO_ROOT.parent / "airbyte-enterprise" / "airbyte-integrations").is_dir(),
21-
])
16+
return all(
17+
[
18+
CDK_REPO_ROOT.name == "airbyte-python-cdk",
19+
(CDK_REPO_ROOT.parent / "airbyte").is_dir(),
20+
(CDK_REPO_ROOT.parent / "airbyte-enterprise").is_dir(),
21+
(CDK_REPO_ROOT.parent / "airbyte" / "airbyte-integrations").is_dir(),
22+
(CDK_REPO_ROOT.parent / "airbyte-enterprise" / "airbyte-integrations").is_dir(),
23+
]
24+
)
2225

2326

2427
@pytest.mark.parametrize(
2528
"start_dir_rel, expect_success",
2629
[
2730
(CDK_REPO_ROOT / ".." / "airbyte", True),
2831
(CDK_REPO_ROOT / ".." / "airbyte" / "airbyte-ci", True),
29-
(CDK_REPO_ROOT.parent, True), # Parent directory from CDK repo
30-
(CDK_REPO_ROOT.parent.parent, False), # Grandparent directory from CDK repo
32+
(CDK_REPO_ROOT.parent, True), # Parent directory from CDK repo
33+
(CDK_REPO_ROOT.parent.parent, False), # Grandparent directory from CDK repo
3134
(CDK_REPO_ROOT / ".." / "airbyte-enterprise", True),
3235
(CDK_REPO_ROOT / ".." / "airbyte-enterprise" / "airbyte-integrations", True),
3336
(Path("/"), False), # Filesystem root
@@ -77,6 +80,4 @@ def test_resolve_airbyte_repo_root_real_fs(
7780
)
7881
except FileNotFoundError:
7982
if expect_success:
80-
raise AssertionError(
81-
f"Airbyte repo root not found from '{start_dir_rel!s}'."
82-
)
83+
raise AssertionError(f"Airbyte repo root not found from '{start_dir_rel!s}'.")

0 commit comments

Comments
 (0)