ingestify 0.6.3__py3-none-any.whl → 0.6.4__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
@@ -8,4 +8,4 @@ if not __INGESTIFY_SETUP__:
8
8
  from .infra import retrieve_http
9
9
  from .source_base import Source, DatasetResource
10
10
 
11
- __version__ = "0.6.3"
11
+ __version__ = "0.6.4"
@@ -268,33 +268,35 @@ class SqlAlchemyDatasetRepository(DatasetRepository):
268
268
  if not selectors:
269
269
  raise ValueError("Selectors must contain at least one item")
270
270
 
271
- attribute_cte = self._build_cte(
272
- [selector.filtered_attributes for selector in selectors], "attributes"
273
- )
274
-
275
- keys = list(selectors[0].filtered_attributes.keys())
276
271
  first_selector = selectors[0].filtered_attributes
272
+ keys = list(first_selector.keys())
277
273
 
278
- join_conditions = []
279
- for k in keys:
280
- if dialect == "postgresql":
281
- column = dataset_table.c.identifier[k]
274
+ if keys:
275
+ attribute_cte = self._build_cte(
276
+ [selector.filtered_attributes for selector in selectors],
277
+ "attributes",
278
+ )
282
279
 
283
- # Take the value from the first selector to determine the type.
284
- # TODO: check all selectors to determine the type
285
- v = first_selector[k]
286
- if isinstance(v, int):
287
- column = column.as_integer()
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()
288
292
  else:
289
- column = column.as_string()
290
- else:
291
- column = func.json_extract(dataset_table.c.identifier, f"$.{k}")
293
+ column = func.json_extract(dataset_table.c.identifier, f"$.{k}")
292
294
 
293
- join_conditions.append(attribute_cte.c[k] == column)
295
+ join_conditions.append(attribute_cte.c[k] == column)
294
296
 
295
- query = query.select_from(
296
- dataset_table.join(attribute_cte, and_(*join_conditions))
297
- )
297
+ query = query.select_from(
298
+ dataset_table.join(attribute_cte, and_(*join_conditions))
299
+ )
298
300
 
299
301
  if where:
300
302
  query = query.filter(text(where))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ingestify
3
- Version: 0.6.3
3
+ Version: 0.6.4
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=CuCiGM6aFbNz1p2VC92CWR5tn9t7b_2nWoW7dlO4ADQ,301
1
+ ingestify/__init__.py,sha256=6tuDYCbk78GEM1qI7Uy35u62q6nyriksCeJ7JcD7W98,301
2
2
  ingestify/cmdline.py,sha256=JcveX6e4i6mJtIllhTuruwbqxyoKIITIWE8kB6byvJU,7721
3
3
  ingestify/exceptions.py,sha256=izRzaLQmMy-4P8ZqGqVZyf4k6LFYOYqwYLuRaUH8BJw,187
4
4
  ingestify/main.py,sha256=yYKA-4WAk04RdBCGmatsCKiPFQzpyufoG4VzHiWkVtU,8979
@@ -64,7 +64,7 @@ ingestify/infra/source/wyscout.py,sha256=DxCzdkzYpVRHTfV9GpF8pe3FzwIk-WHYUlea6nO
64
64
  ingestify/infra/store/__init__.py,sha256=3dA6NWfB6FS5SFdQiSlJ0ZghBfnUAUuGIP5Vr4rkCqk,43
65
65
  ingestify/infra/store/dataset/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
66
66
  ingestify/infra/store/dataset/sqlalchemy/__init__.py,sha256=Z5JHWGO_hwT6rO-ecMOOAmOKjFFJi449KZvJTQgt6vQ,52
67
- ingestify/infra/store/dataset/sqlalchemy/repository.py,sha256=8zMPA4jeAPNLXZ2zzpG9SClto8ysqgA341JYsZPQNHg,19812
67
+ ingestify/infra/store/dataset/sqlalchemy/repository.py,sha256=vO5usxMbMks7EKPASVCj6bjVld7c9LmlQkWNqLU-Kvs,19916
68
68
  ingestify/infra/store/dataset/sqlalchemy/tables.py,sha256=kALM32jbdeZ4Wn9gON-w2WSb5tH1lIWaBFgn5i29qTk,10635
69
69
  ingestify/infra/store/file/__init__.py,sha256=DuEekZa2pmDuRCFiulbgoGotN0wGv3OrRXSvokY0PhY,104
70
70
  ingestify/infra/store/file/dummy_file_repository.py,sha256=azUq9c43Mz9-GWk9j0E97BaqyUKu-ZMrcuaIednLq5E,723
@@ -80,8 +80,8 @@ ingestify/static/templates/wyscout/README.md,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRk
80
80
  ingestify/static/templates/wyscout/config.yaml.jinja2,sha256=0zQXuvJVwd0oL2OJsPMZ8sOvRbdfRbieSGLQ44ezmYc,379
81
81
  ingestify/static/templates/wyscout/query.py,sha256=wjAOMoKvhX-BzCRqEm1SJp6YAcF8Fsq7ddrOaOpAeOk,364
82
82
  ingestify/static/templates/wyscout/database/README.md,sha256=7IuzjKo7Pqkx5wkmOETRZDljVOslqfA3ALuHMONq5dg,32
83
- ingestify-0.6.3.dist-info/METADATA,sha256=-EpbTNkY4-qoUXCvfnM4Lpe_qdmNXGLm8SzL20kQ1AE,18854
84
- ingestify-0.6.3.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
85
- ingestify-0.6.3.dist-info/entry_points.txt,sha256=czYYXeX2ul4zdeB6bKlz3HaUF7zyVVcj9E_sRNDisI0,53
86
- ingestify-0.6.3.dist-info/top_level.txt,sha256=Lwnjgns4KequS7KiicXhh6mLUvcdfjzLyPI4qf_s4A0,10
87
- ingestify-0.6.3.dist-info/RECORD,,
83
+ ingestify-0.6.4.dist-info/METADATA,sha256=g34iFogx4pOE2FYe2wbNZg9TwH_ufGSBOSrodty--NU,18854
84
+ ingestify-0.6.4.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
85
+ ingestify-0.6.4.dist-info/entry_points.txt,sha256=czYYXeX2ul4zdeB6bKlz3HaUF7zyVVcj9E_sRNDisI0,53
86
+ ingestify-0.6.4.dist-info/top_level.txt,sha256=Lwnjgns4KequS7KiicXhh6mLUvcdfjzLyPI4qf_s4A0,10
87
+ ingestify-0.6.4.dist-info/RECORD,,