ingestify 0.9.3__tar.gz → 0.9.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ingestify-0.9.3 → ingestify-0.9.4}/PKG-INFO +1 -1
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/__init__.py +1 -1
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/ingestion/ingestion_job.py +1 -1
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/resources/dataset_resource.py +6 -3
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/tests/test_engine.py +13 -1
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify.egg-info/PKG-INFO +1 -1
- {ingestify-0.9.3 → ingestify-0.9.4}/README.md +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/application/__init__.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/application/dataset_store.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/application/ingestion_engine.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/application/loader.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/application/secrets_manager.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/cmdline.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/__init__.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/__init__.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/base.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/data_spec_version_collection.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/dataset/__init__.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/dataset/collection.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/dataset/collection_metadata.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/dataset/dataset.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/dataset/dataset_repository.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/dataset/dataset_state.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/dataset/events.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/dataset/file.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/dataset/file_collection.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/dataset/file_repository.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/dataset/identifier.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/dataset/revision.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/dataset/selector.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/event/__init__.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/event/_old_event.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/event/dispatcher.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/event/domain_event.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/event/event_bus.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/event/publisher.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/event/subscriber.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/fetch_policy.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/ingestion/__init__.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/ingestion/ingestion_job_summary.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/ingestion/ingestion_plan.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/resources/__init__.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/sink.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/source.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/task/__init__.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/task/set.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/task/task.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/task/task_summary.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/timing.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/services/__init__.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/services/identifier_key_transformer.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/services/transformers/__init__.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/services/transformers/kloppy_to_pandas.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/exceptions.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/infra/__init__.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/infra/fetch/__init__.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/infra/fetch/http.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/infra/serialization/__init__.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/infra/sink/__init__.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/infra/sink/postgresql.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/infra/source/__init__.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/infra/source/statsbomb/__init__.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/infra/source/statsbomb/base.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/infra/source/statsbomb/match.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/infra/source/statsbomb_github.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/infra/store/__init__.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/infra/store/dataset/__init__.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/infra/store/dataset/sqlalchemy/__init__.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/infra/store/dataset/sqlalchemy/repository.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/infra/store/dataset/sqlalchemy/tables.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/infra/store/file/__init__.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/infra/store/file/dummy_file_repository.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/infra/store/file/local_file_repository.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/infra/store/file/s3_file_repository.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/main.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/server.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/source_base.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/tests/__init__.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/tests/conftest.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/tests/test_auto_ingest.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/tests/test_events.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/tests/test_file_cache.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/tests/test_pagination.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/tests/test_store_version.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/tests/test_table_prefix.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify/utils.py +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify.egg-info/SOURCES.txt +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify.egg-info/dependency_links.txt +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify.egg-info/entry_points.txt +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify.egg-info/requires.txt +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/ingestify.egg-info/top_level.txt +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/setup.cfg +0 -0
- {ingestify-0.9.3 → ingestify-0.9.4}/setup.py +0 -0
|
@@ -137,7 +137,7 @@ class UpdateDatasetTask(Task):
|
|
|
137
137
|
for file_id, file_resource in self.dataset_resource.files.items()
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
self.dataset_resource.run_post_load_files(files)
|
|
140
|
+
self.dataset_resource.run_post_load_files(files, self.dataset)
|
|
141
141
|
|
|
142
142
|
try:
|
|
143
143
|
revision = self.store.update_dataset(
|
|
@@ -3,6 +3,7 @@ from typing import Optional, Callable, Any, Protocol, TYPE_CHECKING, Dict # noq
|
|
|
3
3
|
from pydantic import Field
|
|
4
4
|
|
|
5
5
|
from ingestify.domain.models.base import BaseModel
|
|
6
|
+
from ingestify.domain.models.dataset import Dataset
|
|
6
7
|
from ingestify.domain.models.dataset.dataset_state import DatasetState
|
|
7
8
|
from ingestify.exceptions import DuplicateFile
|
|
8
9
|
|
|
@@ -51,17 +52,19 @@ class DatasetResource(BaseModel):
|
|
|
51
52
|
state: DatasetState = Field(default_factory=lambda: DatasetState.COMPLETE)
|
|
52
53
|
files: dict[str, FileResource] = Field(default_factory=dict)
|
|
53
54
|
post_load_files: Optional[
|
|
54
|
-
Callable[["DatasetResource", Dict[str, DraftFile]], None]
|
|
55
|
+
Callable[["DatasetResource", Dict[str, DraftFile], Optional[Dataset]], None]
|
|
55
56
|
] = None
|
|
56
57
|
|
|
57
|
-
def run_post_load_files(
|
|
58
|
+
def run_post_load_files(
|
|
59
|
+
self, files: Dict[str, DraftFile], existing_dataset: Optional[Dataset] = None
|
|
60
|
+
):
|
|
58
61
|
"""Hook to modify dataset attributes based on loaded file content.
|
|
59
62
|
|
|
60
63
|
Useful for setting state based on file content, e.g., keep state=SCHEDULED
|
|
61
64
|
when files contain '{}', change to COMPLETE when they contain actual data.
|
|
62
65
|
"""
|
|
63
66
|
if self.post_load_files:
|
|
64
|
-
self.post_load_files(self, files)
|
|
67
|
+
self.post_load_files(self, files, existing_dataset)
|
|
65
68
|
|
|
66
69
|
def add_file(
|
|
67
70
|
self,
|
|
@@ -460,7 +460,9 @@ def test_dev_engine():
|
|
|
460
460
|
assert datasets.first().name == "Test Dataset"
|
|
461
461
|
|
|
462
462
|
|
|
463
|
-
def post_load_hook(
|
|
463
|
+
def post_load_hook(
|
|
464
|
+
dataset_resource: DatasetResource, files: dict[str, DraftFile], existing_dataset
|
|
465
|
+
):
|
|
464
466
|
# Change state to COMPLETE if file content is not '{}'
|
|
465
467
|
for file in files.values():
|
|
466
468
|
if file.size > 2:
|
|
@@ -545,3 +547,13 @@ def test_force_save_creates_revision(config_file):
|
|
|
545
547
|
dataset_without_files = engine.store.get_dataset_collection(season_id=3).first()
|
|
546
548
|
assert len(dataset_without_files.revisions) == 1
|
|
547
549
|
assert len(dataset_without_files.current_revision.modified_files) == 0
|
|
550
|
+
|
|
551
|
+
dataset_with_last_modified = engine.store.get_dataset_collection(
|
|
552
|
+
season_id=2
|
|
553
|
+
).first()
|
|
554
|
+
|
|
555
|
+
dataset_without_files = engine.store.get_dataset_collection(metadata_only=True)
|
|
556
|
+
assert (
|
|
557
|
+
dataset_without_files.metadata.last_modified
|
|
558
|
+
== dataset_with_last_modified.last_modified_at
|
|
559
|
+
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/models/ingestion/ingestion_job_summary.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ingestify-0.9.3 → ingestify-0.9.4}/ingestify/domain/services/transformers/kloppy_to_pandas.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|