datamarket 0.9.33__tar.gz → 0.9.34__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.
Potentially problematic release.
This version of datamarket might be problematic. Click here for more details.
- {datamarket-0.9.33 → datamarket-0.9.34}/PKG-INFO +1 -1
- {datamarket-0.9.33 → datamarket-0.9.34}/pyproject.toml +1 -1
- {datamarket-0.9.33 → datamarket-0.9.34}/src/datamarket/interfaces/alchemy.py +9 -6
- {datamarket-0.9.33 → datamarket-0.9.34}/src/datamarket/utils/strings/normalization.py +5 -5
- {datamarket-0.9.33 → datamarket-0.9.34}/LICENSE +0 -0
- {datamarket-0.9.33 → datamarket-0.9.34}/README.md +0 -0
- {datamarket-0.9.33 → datamarket-0.9.34}/src/datamarket/__init__.py +0 -0
- {datamarket-0.9.33 → datamarket-0.9.34}/src/datamarket/interfaces/__init__.py +0 -0
- {datamarket-0.9.33 → datamarket-0.9.34}/src/datamarket/interfaces/aws.py +0 -0
- {datamarket-0.9.33 → datamarket-0.9.34}/src/datamarket/interfaces/drive.py +0 -0
- {datamarket-0.9.33 → datamarket-0.9.34}/src/datamarket/interfaces/ftp.py +0 -0
- {datamarket-0.9.33 → datamarket-0.9.34}/src/datamarket/interfaces/nominatim.py +0 -0
- {datamarket-0.9.33 → datamarket-0.9.34}/src/datamarket/interfaces/peerdb.py +0 -0
- {datamarket-0.9.33 → datamarket-0.9.34}/src/datamarket/interfaces/proxy.py +0 -0
- {datamarket-0.9.33 → datamarket-0.9.34}/src/datamarket/interfaces/tinybird.py +0 -0
- {datamarket-0.9.33 → datamarket-0.9.34}/src/datamarket/params/__init__.py +0 -0
- {datamarket-0.9.33 → datamarket-0.9.34}/src/datamarket/params/nominatim.py +0 -0
- {datamarket-0.9.33 → datamarket-0.9.34}/src/datamarket/utils/__init__.py +0 -0
- {datamarket-0.9.33 → datamarket-0.9.34}/src/datamarket/utils/airflow.py +0 -0
- {datamarket-0.9.33 → datamarket-0.9.34}/src/datamarket/utils/alchemy.py +0 -0
- {datamarket-0.9.33 → datamarket-0.9.34}/src/datamarket/utils/main.py +0 -0
- {datamarket-0.9.33 → datamarket-0.9.34}/src/datamarket/utils/selenium.py +0 -0
- {datamarket-0.9.33 → datamarket-0.9.34}/src/datamarket/utils/soda.py +0 -0
- {datamarket-0.9.33 → datamarket-0.9.34}/src/datamarket/utils/strings/__init__.py +0 -0
- {datamarket-0.9.33 → datamarket-0.9.34}/src/datamarket/utils/strings/obfuscation.py +0 -0
- {datamarket-0.9.33 → datamarket-0.9.34}/src/datamarket/utils/typer.py +0 -0
- {datamarket-0.9.33 → datamarket-0.9.34}/src/datamarket/utils/types.py +0 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
import logging
|
|
5
5
|
from collections.abc import MutableMapping
|
|
6
|
-
from typing import Any, Iterator, List, Optional, Type, TypeVar
|
|
6
|
+
from typing import Any, Iterator, List, Optional, Type, TypeVar, Union
|
|
7
7
|
from urllib.parse import quote_plus
|
|
8
8
|
|
|
9
9
|
from sqlalchemy import DDL, FrozenResult, Result, Select, SQLColumnExpression, create_engine, text
|
|
@@ -12,7 +12,7 @@ from sqlalchemy.exc import IntegrityError
|
|
|
12
12
|
from sqlalchemy.ext.declarative import DeclarativeMeta
|
|
13
13
|
from sqlalchemy.orm import Session, sessionmaker
|
|
14
14
|
from sqlalchemy.sql.expression import ClauseElement
|
|
15
|
-
from enum import Enum
|
|
15
|
+
from enum import Enum, auto
|
|
16
16
|
|
|
17
17
|
########################################################################################################################
|
|
18
18
|
# CLASSES
|
|
@@ -23,8 +23,8 @@ ModelType = TypeVar("ModelType", bound=DeclarativeMeta)
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
class CommitStrategy(Enum):
|
|
26
|
-
COMMIT_ON_SUCCESS =
|
|
27
|
-
FORCE_COMMIT =
|
|
26
|
+
COMMIT_ON_SUCCESS = auto()
|
|
27
|
+
FORCE_COMMIT = auto()
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
class MockContext:
|
|
@@ -278,7 +278,7 @@ class AlchemyInterface:
|
|
|
278
278
|
stmt: Select[Any],
|
|
279
279
|
order_by: List[SQLColumnExpression[Any]],
|
|
280
280
|
windowsize: int,
|
|
281
|
-
commit_strategy: CommitStrategy = CommitStrategy.COMMIT_ON_SUCCESS,
|
|
281
|
+
commit_strategy: Union[CommitStrategy, str] = CommitStrategy.COMMIT_ON_SUCCESS,
|
|
282
282
|
) -> Iterator[Result[Any]]:
|
|
283
283
|
"""
|
|
284
284
|
Executes a windowed query, fetching each window in a separate, short-lived session.
|
|
@@ -288,7 +288,7 @@ class AlchemyInterface:
|
|
|
288
288
|
order_by: The columns to use for ordering.
|
|
289
289
|
windowsize: The number of rows to fetch in each window.
|
|
290
290
|
commit_strategy: The strategy to use for committing the session after each window.
|
|
291
|
-
Defaults to CommitStrategy.COMMIT_ON_SUCCESS
|
|
291
|
+
Defaults to `CommitStrategy.COMMIT_ON_SUCCESS`.
|
|
292
292
|
|
|
293
293
|
Returns:
|
|
294
294
|
An iterator of Result objects, each containing a window of data.
|
|
@@ -296,6 +296,9 @@ class AlchemyInterface:
|
|
|
296
296
|
|
|
297
297
|
More info: https://github.com/sqlalchemy/sqlalchemy/wiki/RangeQuery-and-WindowedRangeQuery
|
|
298
298
|
"""
|
|
299
|
+
# Parameter mapping
|
|
300
|
+
if isinstance(commit_strategy, str):
|
|
301
|
+
commit_strategy = CommitStrategy[commit_strategy.upper()]
|
|
299
302
|
|
|
300
303
|
# Find id column in stmt
|
|
301
304
|
if not any(column.get("entity").id for column in stmt.column_descriptions):
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
import unicodedata
|
|
5
5
|
from enum import Enum, auto
|
|
6
|
-
from typing import Any, Optional, Set
|
|
6
|
+
from typing import Any, Optional, Set, Union
|
|
7
7
|
|
|
8
8
|
import numpy as np
|
|
9
9
|
from inflection import camelize, parameterize, titleize, underscore
|
|
@@ -93,8 +93,8 @@ def transliterate_symbols(s: str, allowed_symbols_set: Optional[Set[str]] = None
|
|
|
93
93
|
|
|
94
94
|
def normalize(
|
|
95
95
|
s: Any,
|
|
96
|
-
mode: NormalizationMode = NormalizationMode.BASIC,
|
|
97
|
-
naming: NamingConvention = NamingConvention.LOWER,
|
|
96
|
+
mode: Union[NormalizationMode, str] = NormalizationMode.BASIC,
|
|
97
|
+
naming: Union[NamingConvention, str] = NamingConvention.LOWER,
|
|
98
98
|
allowed_symbols: Optional[str] = None,
|
|
99
99
|
) -> str:
|
|
100
100
|
"""
|
|
@@ -136,9 +136,9 @@ def normalize(
|
|
|
136
136
|
"""
|
|
137
137
|
# Parameter mapping
|
|
138
138
|
if isinstance(mode, str):
|
|
139
|
-
mode = NormalizationMode[mode]
|
|
139
|
+
mode = NormalizationMode[mode.upper()]
|
|
140
140
|
if isinstance(naming, str):
|
|
141
|
-
naming = NamingConvention[naming]
|
|
141
|
+
naming = NamingConvention[naming.upper()]
|
|
142
142
|
|
|
143
143
|
_allowed_symbols_set: Set[str] = set(allowed_symbols) if allowed_symbols else set()
|
|
144
144
|
|
|
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
|