Skip to content

Commit 0f42e09

Browse files
committed
integrate with repository infrastructure
1 parent 9342674 commit 0f42e09

File tree

13 files changed

+98
-55
lines changed

13 files changed

+98
-55
lines changed

.github/workflows/rw-collect-changes.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,4 @@ jobs:
4848
- 'gooddata-dbt/**'
4949
- 'gooddata-flight-server/**'
5050
- 'gooddata-flexconnect/**'
51+
- 'gooddata-pipelines/**'

gooddata-pipelines/Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# (C) 2025 GoodData Corporation
2+
3+
# Skip tests if running Python 3.9 from CI (gooddata-pipelines doesn't support py39)
4+
ifeq ($(TEST_ENVS),py39)
5+
.PHONY: test-ci
6+
test-ci:
7+
@echo "Skipping tests for Python 3.9 - gooddata-pipelines doesn't support this version"
8+
@exit 0
9+
10+
.PHONY: test
11+
test:
12+
@echo "Skipping tests for Python 3.9 - gooddata-pipelines doesn't support this version"
13+
@exit 0
14+
else
15+
include ../project_common.mk
16+
endif

gooddata-pipelines/gooddata_pipelines/api/gooddata_sdk.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"""Interaction with GoodData Cloud via the Gooddata Python SDK."""
44

55
from pathlib import Path
6+
from typing import Callable
67

78
from gooddata_sdk.catalog.permission.declarative_model.permission import (
89
CatalogDeclarativeWorkspacePermissions,
@@ -23,8 +24,8 @@
2324
from gooddata_pipelines.api.utils import raise_with_context
2425

2526

26-
def apply_to_all_methods(decorator):
27-
def decorate(cls):
27+
def apply_to_all_methods(decorator: Callable) -> Callable:
28+
def decorate(cls: type) -> type:
2829
for attr in cls.__dict__:
2930
if callable(getattr(cls, attr)) and not attr.startswith("__"):
3031
setattr(cls, attr, decorator(getattr(cls, attr)))

gooddata-pipelines/gooddata_pipelines/backup_and_restore/backup_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def store_user_data_filters(
105105
user_data_filters: dict,
106106
export_path: Path,
107107
ws_id: str,
108-
):
108+
) -> None:
109109
"""Stores the user data filters in the specified export path."""
110110
os.mkdir(
111111
os.path.join(
@@ -136,7 +136,7 @@ def move_folder(source: Path, destination: Path) -> None:
136136
shutil.move(source, destination)
137137

138138
@staticmethod
139-
def write_to_yaml(path: str, source):
139+
def write_to_yaml(path: str, source: Any) -> None:
140140
"""Writes the source to a YAML file."""
141141
with open(path, "w") as outfile:
142142
yaml.dump(source, outfile)

gooddata-pipelines/gooddata_pipelines/backup_and_restore/storage/base_storage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ def __init__(self, conf: BackupRestoreConfig):
1313
self.logger = LogObserver()
1414

1515
@abc.abstractmethod
16-
def export(self, folder, org_id):
16+
def export(self, folder: str, org_id: str) -> None:
1717
"""Exports the content of the folder to the storage."""
1818
raise NotImplementedError

gooddata-pipelines/gooddata_pipelines/backup_and_restore/storage/local_storage.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,18 @@ class LocalStorage(BackupStorage):
1515
def __init__(self, conf: BackupRestoreConfig):
1616
super().__init__(conf)
1717

18-
def _export(self, folder, org_id, export_folder="local_backups") -> None:
18+
def _export(
19+
self, folder: str, org_id: str, export_folder: str = "local_backups"
20+
) -> None:
1921
"""Copies the content of the folder to local storage as backup."""
2022
self.logger.info(f"Saving {org_id} to local storage")
2123
shutil.copytree(
2224
Path(folder), Path(Path.cwd(), export_folder), dirs_exist_ok=True
2325
)
2426

25-
def export(self, folder, org_id, export_folder="local_backups") -> None:
27+
def export(
28+
self, folder: str, org_id: str, export_folder: str = "local_backups"
29+
) -> None:
2630
"""Copies the content of the folder to local storage as backup."""
2731
try:
2832
self._export(folder, org_id, export_folder)

gooddata-pipelines/gooddata_pipelines/backup_and_restore/storage/s3_storage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def _verify_connection(self) -> None:
5252
f"Failed to connect to S3 bucket {self._config.bucket}: {e}"
5353
)
5454

55-
def export(self, folder, org_id) -> None:
55+
def export(self, folder: str, org_id: str) -> None:
5656
"""Uploads the content of the folder to S3 as backup."""
5757
storage_path = f"{self._config.bucket}/{self._backup_path}"
5858
self.logger.info(f"Uploading {org_id} to {storage_path}")

gooddata-pipelines/poetry.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gooddata-pipelines/pyproject.toml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ license = { text = "BSD" }
88
readme = "README.md"
99
requires-python = ">=3.10"
1010
dependencies = [
11-
"pydantic (==2.11.3)",
12-
"requests (==2.32.3)",
13-
"types-requests (==2.32.0.20250602)",
14-
"gooddata-sdk (==1.43.0)",
11+
"pydantic (>=2.11.3,<3.0.0)",
12+
"requests (>=2.32.3,<3.0.0)",
13+
"types-requests (>=2.32.0,<3.0.0)",
14+
"gooddata-sdk (>=1.43.0,<2.0.0)",
1515
"boto3 (>=1.39.3,<2.0.0)",
1616
"boto3-stubs (>=1.39.3,<2.0.0)",
17-
"types-pyyaml (==6.0.12.20250326)",
17+
"types-pyyaml (>=6.0.12.20250326,<7.0.0)",
1818
]
1919

2020
[tool.mypy]
@@ -29,11 +29,11 @@ line-length = 80
2929

3030
[project.optional-dependencies]
3131
dev = [
32-
"pytest==8.3.5",
33-
"pytest-mock==3.14.0",
34-
"ruff==0.11.2",
35-
"mypy>=1.16.0",
36-
"moto==5.1.6",
32+
"pytest (>=8.3.5,<9.0.0)",
33+
"pytest-mock (>=3.14.0,<4.0.0)",
34+
"ruff (>=0.11.2,<0.12.0)",
35+
"mypy (>=1.16.0,<2.0.0)",
36+
"moto (>=5.1.6,<6.0.0)",
3737
]
3838

3939
[build-system]

gooddata-pipelines/tests/backup_and_restore/test_backup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def backup_manager(mock_logger):
6060

6161

6262
@pytest.fixture()
63-
def s3(aws_credentials):
63+
def s3():
6464
with mock_aws():
6565
yield boto3.resource("s3")
6666

@@ -274,7 +274,7 @@ def test_local_storage_export(backup_manager):
274274
shutil.rmtree("tests/data/local_export")
275275

276276

277-
def test_file_upload(backup_manager, s3, s3_bucket, mock_boto_session):
277+
def test_file_upload(backup_manager, s3, s3_bucket):
278278
backup_manager.storage.export("tests/data/backup/test_exports", "services")
279279
s3.Object(
280280
S3_BUCKET,

0 commit comments

Comments
 (0)