ingestify 0.6.2__tar.gz → 0.6.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.6.2 → ingestify-0.6.4}/PKG-INFO +1 -1
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/__init__.py +1 -1
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/infra/store/dataset/sqlalchemy/repository.py +46 -31
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify.egg-info/PKG-INFO +1 -1
- {ingestify-0.6.2 → ingestify-0.6.4}/README.md +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/application/__init__.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/application/dataset_store.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/application/ingestion_engine.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/application/loader.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/application/secrets_manager.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/cmdline.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/__init__.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/__init__.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/base.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/data_spec_version_collection.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/dataset/__init__.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/dataset/collection.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/dataset/collection_metadata.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/dataset/dataset.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/dataset/dataset_repository.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/dataset/dataset_state.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/dataset/events.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/dataset/file.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/dataset/file_collection.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/dataset/file_repository.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/dataset/identifier.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/dataset/revision.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/dataset/selector.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/event/__init__.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/event/_old_event.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/event/dispatcher.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/event/domain_event.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/event/event_bus.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/event/publisher.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/event/subscriber.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/fetch_policy.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/ingestion/__init__.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/ingestion/ingestion_job.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/ingestion/ingestion_job_summary.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/ingestion/ingestion_plan.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/resources/__init__.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/resources/dataset_resource.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/sink.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/source.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/task/__init__.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/task/set.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/task/task.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/task/task_summary.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/models/timing.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/services/__init__.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/services/identifier_key_transformer.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/services/transformers/__init__.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/domain/services/transformers/kloppy_to_pandas.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/exceptions.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/infra/__init__.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/infra/fetch/__init__.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/infra/fetch/http.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/infra/serialization/__init__.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/infra/sink/__init__.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/infra/sink/postgresql.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/infra/source/__init__.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/infra/source/statsbomb_github.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/infra/source/wyscout.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/infra/store/__init__.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/infra/store/dataset/__init__.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/infra/store/dataset/sqlalchemy/__init__.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/infra/store/dataset/sqlalchemy/tables.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/infra/store/file/__init__.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/infra/store/file/dummy_file_repository.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/infra/store/file/local_file_repository.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/infra/store/file/s3_file_repository.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/main.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/server.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/source_base.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/static/templates/statsbomb_github/README.md +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/static/templates/statsbomb_github/config.yaml.jinja2 +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/static/templates/statsbomb_github/database/README.md +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/static/templates/statsbomb_github/query.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/static/templates/wyscout/.env +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/static/templates/wyscout/.gitignore +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/static/templates/wyscout/README.md +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/static/templates/wyscout/config.yaml.jinja2 +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/static/templates/wyscout/database/README.md +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/static/templates/wyscout/query.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify/utils.py +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify.egg-info/SOURCES.txt +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify.egg-info/dependency_links.txt +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify.egg-info/entry_points.txt +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify.egg-info/requires.txt +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/ingestify.egg-info/top_level.txt +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/setup.cfg +0 -0
- {ingestify-0.6.2 → ingestify-0.6.4}/setup.py +0 -0
|
@@ -152,7 +152,13 @@ class SqlAlchemyDatasetRepository(DatasetRepository):
|
|
|
152
152
|
def dialect(self) -> Dialect:
|
|
153
153
|
return self.session_provider.dialect
|
|
154
154
|
|
|
155
|
-
def _upsert(
|
|
155
|
+
def _upsert(
|
|
156
|
+
self,
|
|
157
|
+
connection: Connection,
|
|
158
|
+
table: Table,
|
|
159
|
+
entities: list[dict],
|
|
160
|
+
immutable_rows: bool = False,
|
|
161
|
+
):
|
|
156
162
|
dialect = self.dialect.name
|
|
157
163
|
if dialect == "mysql":
|
|
158
164
|
from sqlalchemy.dialects.mysql import insert
|
|
@@ -167,13 +173,18 @@ class SqlAlchemyDatasetRepository(DatasetRepository):
|
|
|
167
173
|
|
|
168
174
|
primary_key_columns = [column for column in table.columns if column.primary_key]
|
|
169
175
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
176
|
+
if immutable_rows:
|
|
177
|
+
stmt = stmt.on_conflict_do_nothing(index_elements=primary_key_columns)
|
|
178
|
+
else:
|
|
179
|
+
set_ = {
|
|
180
|
+
name: getattr(stmt.excluded, name)
|
|
181
|
+
for name, column in table.columns.items()
|
|
182
|
+
if column not in primary_key_columns
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
stmt = stmt.on_conflict_do_update(
|
|
186
|
+
index_elements=primary_key_columns, set_=set_
|
|
187
|
+
)
|
|
177
188
|
|
|
178
189
|
connection.execute(stmt)
|
|
179
190
|
|
|
@@ -257,33 +268,35 @@ class SqlAlchemyDatasetRepository(DatasetRepository):
|
|
|
257
268
|
if not selectors:
|
|
258
269
|
raise ValueError("Selectors must contain at least one item")
|
|
259
270
|
|
|
260
|
-
attribute_cte = self._build_cte(
|
|
261
|
-
[selector.filtered_attributes for selector in selectors], "attributes"
|
|
262
|
-
)
|
|
263
|
-
|
|
264
|
-
keys = list(selectors[0].filtered_attributes.keys())
|
|
265
271
|
first_selector = selectors[0].filtered_attributes
|
|
272
|
+
keys = list(first_selector.keys())
|
|
266
273
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
274
|
+
if keys:
|
|
275
|
+
attribute_cte = self._build_cte(
|
|
276
|
+
[selector.filtered_attributes for selector in selectors],
|
|
277
|
+
"attributes",
|
|
278
|
+
)
|
|
271
279
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
280
|
+
join_conditions = []
|
|
281
|
+
for k in keys:
|
|
282
|
+
if dialect == "postgresql":
|
|
283
|
+
column = dataset_table.c.identifier[k]
|
|
284
|
+
|
|
285
|
+
# Take the value from the first selector to determine the type.
|
|
286
|
+
# TODO: check all selectors to determine the type
|
|
287
|
+
v = first_selector[k]
|
|
288
|
+
if isinstance(v, int):
|
|
289
|
+
column = column.as_integer()
|
|
290
|
+
else:
|
|
291
|
+
column = column.as_string()
|
|
277
292
|
else:
|
|
278
|
-
column =
|
|
279
|
-
else:
|
|
280
|
-
column = func.json_extract(dataset_table.c.identifier, f"$.{k}")
|
|
293
|
+
column = func.json_extract(dataset_table.c.identifier, f"$.{k}")
|
|
281
294
|
|
|
282
|
-
|
|
295
|
+
join_conditions.append(attribute_cte.c[k] == column)
|
|
283
296
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
297
|
+
query = query.select_from(
|
|
298
|
+
dataset_table.join(attribute_cte, and_(*join_conditions))
|
|
299
|
+
)
|
|
287
300
|
|
|
288
301
|
if where:
|
|
289
302
|
query = query.filter(text(where))
|
|
@@ -476,8 +489,10 @@ class SqlAlchemyDatasetRepository(DatasetRepository):
|
|
|
476
489
|
with self.connect() as connection:
|
|
477
490
|
try:
|
|
478
491
|
self._upsert(connection, dataset_table, datasets_entities)
|
|
479
|
-
self._upsert(
|
|
480
|
-
|
|
492
|
+
self._upsert(
|
|
493
|
+
connection, revision_table, revision_entities, immutable_rows=True
|
|
494
|
+
)
|
|
495
|
+
self._upsert(connection, file_table, file_entities, immutable_rows=True)
|
|
481
496
|
except Exception:
|
|
482
497
|
connection.rollback()
|
|
483
498
|
raise
|
|
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
|
{ingestify-0.6.2 → ingestify-0.6.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
|
|
File without changes
|
{ingestify-0.6.2 → ingestify-0.6.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
|
{ingestify-0.6.2 → ingestify-0.6.4}/ingestify/static/templates/statsbomb_github/config.yaml.jinja2
RENAMED
|
File without changes
|
{ingestify-0.6.2 → ingestify-0.6.4}/ingestify/static/templates/statsbomb_github/database/README.md
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
|