ingestify 0.9.2__py3-none-any.whl → 0.9.3__py3-none-any.whl

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/__init__.py CHANGED
@@ -9,4 +9,4 @@ if not __INGESTIFY_SETUP__:
9
9
  from .source_base import Source, DatasetResource
10
10
  from .main import debug_source
11
11
 
12
- __version__ = "0.9.2"
12
+ __version__ = "0.9.3"
@@ -470,9 +470,14 @@ class SqlAlchemyDatasetRepository(DatasetRepository):
470
470
  dataset_ids = [row.dataset_id for row in dataset_query]
471
471
  datasets = self._load_datasets(dataset_ids)
472
472
 
473
+ last_modified_values = [
474
+ dataset.last_modified_at
475
+ for dataset in datasets
476
+ if dataset.last_modified_at is not None
477
+ ]
473
478
  dataset_collection_metadata = DatasetCollectionMetadata(
474
- last_modified=max(dataset.last_modified_at for dataset in datasets)
475
- if datasets
479
+ last_modified=max(last_modified_values)
480
+ if last_modified_values
476
481
  else None,
477
482
  row_count=len(datasets),
478
483
  )
@@ -526,12 +526,22 @@ def test_post_load_files_hook(config_file):
526
526
  def test_force_save_creates_revision(config_file):
527
527
  """Test that datasets get a revision even when no files are persisted."""
528
528
  engine = get_engine(config_file, "main")
529
+
530
+ # Create one dataset with files and one without
531
+ add_ingestion_plan(
532
+ engine, SimpleFakeSource("fake-source"), competition_id=1, season_id=2
533
+ )
529
534
  add_ingestion_plan(
530
- engine, NoFilesSource("fake-source"), competition_id=1, season_id=2
535
+ engine, NoFilesSource("fake-source"), competition_id=1, season_id=3
531
536
  )
532
537
 
533
538
  engine.load()
534
- dataset = engine.store.get_dataset_collection().first()
535
539
 
536
- assert len(dataset.revisions) == 1
537
- assert len(dataset.current_revision.modified_files) == 0
540
+ # This should not fail even though one dataset has no last_modified_at
541
+ datasets = engine.store.get_dataset_collection()
542
+ assert len(datasets) == 2
543
+
544
+ # Verify the dataset without files still has a revision
545
+ dataset_without_files = engine.store.get_dataset_collection(season_id=3).first()
546
+ assert len(dataset_without_files.revisions) == 1
547
+ assert len(dataset_without_files.current_revision.modified_files) == 0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ingestify
3
- Version: 0.9.2
3
+ Version: 0.9.3
4
4
  Summary: Data Ingestion Framework
5
5
  Author: Koen Vossen
6
6
  Author-email: info@koenvossen.nl
@@ -1,4 +1,4 @@
1
- ingestify/__init__.py,sha256=zFlvArmYGeebwjI5szpq8FLAYq8kpDb0ri9uh-5Yjrs,336
1
+ ingestify/__init__.py,sha256=fKX1lkxZhmjQ4aSvq_0_PN3XTXBwPP4jVJE-Ad2x8LM,336
2
2
  ingestify/cmdline.py,sha256=Rs1_lSKSIJrcygH5fvtOGicOl_e0sZYW7deqp4_jGbY,6233
3
3
  ingestify/exceptions.py,sha256=izRzaLQmMy-4P8ZqGqVZyf4k6LFYOYqwYLuRaUH8BJw,187
4
4
  ingestify/main.py,sha256=mMXDNzSl1dzN03BUiS97uP3XwFMdgadxP0hJlONsZ_g,15789
@@ -66,7 +66,7 @@ ingestify/infra/source/statsbomb/match.py,sha256=8Zpdys6-bB_ral2AmjGKhF4BnXW3F0Y
66
66
  ingestify/infra/store/__init__.py,sha256=3dA6NWfB6FS5SFdQiSlJ0ZghBfnUAUuGIP5Vr4rkCqk,43
67
67
  ingestify/infra/store/dataset/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
68
68
  ingestify/infra/store/dataset/sqlalchemy/__init__.py,sha256=Z5JHWGO_hwT6rO-ecMOOAmOKjFFJi449KZvJTQgt6vQ,52
69
- ingestify/infra/store/dataset/sqlalchemy/repository.py,sha256=v-JrX09zqheUklevXryev2_H1m0flYxJQFQBkZhVS24,24255
69
+ ingestify/infra/store/dataset/sqlalchemy/repository.py,sha256=2z_a1ICIokx5yUGz1Jn-DBvFzK1pryAjPYLQTP3pxAw,24447
70
70
  ingestify/infra/store/dataset/sqlalchemy/tables.py,sha256=1FewCsN7jdk1ITzL_neOwJWtHD03NxCS9E8dhZcz4oY,12236
71
71
  ingestify/infra/store/file/__init__.py,sha256=DuEekZa2pmDuRCFiulbgoGotN0wGv3OrRXSvokY0PhY,104
72
72
  ingestify/infra/store/file/dummy_file_repository.py,sha256=azUq9c43Mz9-GWk9j0E97BaqyUKu-ZMrcuaIednLq5E,723
@@ -75,14 +75,14 @@ ingestify/infra/store/file/s3_file_repository.py,sha256=tz_EZ_gun7W2qJMlI3j_R03i
75
75
  ingestify/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
76
76
  ingestify/tests/conftest.py,sha256=Cr768nLMWUfIP6FMR7aFhUCY4uQ9Tz_bXOq0udpiDEE,411
77
77
  ingestify/tests/test_auto_ingest.py,sha256=coMOzJBTbeDwUSYDLnqmkaCXpG-6WQeKqf_nj9XFiA4,14502
78
- ingestify/tests/test_engine.py,sha256=ooqy4EjDSBFo3aHIlnqjokj9r8PnNcYxzl0rhPc0fVo,16783
78
+ ingestify/tests/test_engine.py,sha256=5EKBTZLms38hjkgDjmRH_ATiZI6FWou4Bt5IJIsE7os,17217
79
79
  ingestify/tests/test_events.py,sha256=A1f8H4HRyn52SWo3wV_MgSeb6IbT_lNi9wWAK8EGsK4,7806
80
80
  ingestify/tests/test_file_cache.py,sha256=Xbh_VLLDH-KQXE3MeujDeOjjYYbAnjGR6wsHwMInKco,3049
81
81
  ingestify/tests/test_pagination.py,sha256=uAKDMsM6fYSa4NcAlXDllu2y-8lnh0AclhPZ5MWJKn8,5539
82
82
  ingestify/tests/test_store_version.py,sha256=4czUG8LtaGxgjW4trw7BzYJA8blQp3-HM8w-7HjqFl0,2508
83
83
  ingestify/tests/test_table_prefix.py,sha256=6N42T6hfulqTlsUlrwhNmZ-TK-ZOt4U8Jx9NxKyLS4I,2844
84
- ingestify-0.9.2.dist-info/METADATA,sha256=wbLlX2aaVowBJRKKOvz817ipB48gZmMeE48EcJgMycs,8263
85
- ingestify-0.9.2.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
86
- ingestify-0.9.2.dist-info/entry_points.txt,sha256=czYYXeX2ul4zdeB6bKlz3HaUF7zyVVcj9E_sRNDisI0,53
87
- ingestify-0.9.2.dist-info/top_level.txt,sha256=Lwnjgns4KequS7KiicXhh6mLUvcdfjzLyPI4qf_s4A0,10
88
- ingestify-0.9.2.dist-info/RECORD,,
84
+ ingestify-0.9.3.dist-info/METADATA,sha256=XKCP3xKunZ9ENLwv8Bn3q8K8yDEZQEI6E0ro--N95xE,8263
85
+ ingestify-0.9.3.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
86
+ ingestify-0.9.3.dist-info/entry_points.txt,sha256=czYYXeX2ul4zdeB6bKlz3HaUF7zyVVcj9E_sRNDisI0,53
87
+ ingestify-0.9.3.dist-info/top_level.txt,sha256=Lwnjgns4KequS7KiicXhh6mLUvcdfjzLyPI4qf_s4A0,10
88
+ ingestify-0.9.3.dist-info/RECORD,,