castor-extractor 0.25.10__py3-none-any.whl → 0.25.14__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.
Potentially problematic release.
This version of castor-extractor might be problematic. Click here for more details.
- CHANGELOG.md +18 -0
- castor_extractor/commands/__init__.py +3 -0
- castor_extractor/exceptions.py +5 -0
- castor_extractor/transformation/coalesce/client/client.py +25 -2
- castor_extractor/visualization/sigma/client/client.py +6 -1
- castor_extractor/warehouse/snowflake/queries/table.sql +2 -1
- {castor_extractor-0.25.10.dist-info → castor_extractor-0.25.14.dist-info}/METADATA +19 -2
- {castor_extractor-0.25.10.dist-info → castor_extractor-0.25.14.dist-info}/RECORD +11 -11
- {castor_extractor-0.25.10.dist-info → castor_extractor-0.25.14.dist-info}/LICENCE +0 -0
- {castor_extractor-0.25.10.dist-info → castor_extractor-0.25.14.dist-info}/WHEEL +0 -0
- {castor_extractor-0.25.10.dist-info → castor_extractor-0.25.14.dist-info}/entry_points.txt +0 -0
CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.25.14 - 2025-10-28
|
|
4
|
+
|
|
5
|
+
* Removing unused dependency (google-cloud-storage)
|
|
6
|
+
|
|
7
|
+
## 0.25.13 - 2025-10-16
|
|
8
|
+
|
|
9
|
+
* Coalesce:
|
|
10
|
+
* reduce pagination
|
|
11
|
+
* retry once on ReadTimeout or ConnectionTimeout
|
|
12
|
+
|
|
13
|
+
## 0.25.12 - 2025-10-16
|
|
14
|
+
|
|
15
|
+
* Add a deprecation warning for Python versions below 3.10
|
|
16
|
+
|
|
17
|
+
## 0.25.11 - 2025-10-15
|
|
18
|
+
|
|
19
|
+
* Sigma: catch ReadTimeouts during queries extraction
|
|
20
|
+
|
|
3
21
|
## 0.25.10 - 2025-10-09
|
|
4
22
|
|
|
5
23
|
* Fix import
|
castor_extractor/exceptions.py
CHANGED
|
@@ -3,3 +3,8 @@ class NoDatabaseProvidedException(Exception):
|
|
|
3
3
|
super().__init__("""No database eligible for extraction.
|
|
4
4
|
If you are using the db_allow/db_block options, please make sure to use the correct case.
|
|
5
5
|
""")
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class TestConnectionException(Exception):
|
|
9
|
+
def __init__(self, caused_by: Exception):
|
|
10
|
+
super().__init__(f"Connection could not be verified: {caused_by}")
|
|
@@ -3,12 +3,16 @@ from functools import partial
|
|
|
3
3
|
from http import HTTPStatus
|
|
4
4
|
from typing import Callable, Optional
|
|
5
5
|
|
|
6
|
+
from requests.exceptions import ConnectTimeout, ReadTimeout
|
|
7
|
+
|
|
8
|
+
from ....exceptions import TestConnectionException
|
|
6
9
|
from ....utils import (
|
|
7
10
|
APIClient,
|
|
8
11
|
BearerAuth,
|
|
9
12
|
RequestSafeMode,
|
|
10
13
|
SerializedAsset,
|
|
11
14
|
fetch_all_pages,
|
|
15
|
+
retry,
|
|
12
16
|
)
|
|
13
17
|
from ..assets import CoalesceAsset, CoalesceQualityAsset
|
|
14
18
|
from .credentials import CoalesceCredentials
|
|
@@ -19,10 +23,12 @@ from .pagination import CoalescePagination
|
|
|
19
23
|
|
|
20
24
|
logger = logging.getLogger(__name__)
|
|
21
25
|
|
|
22
|
-
|
|
23
|
-
|
|
26
|
+
# increase pagination when extraction is too slow
|
|
27
|
+
# reduce pagination when hitting timeouts
|
|
28
|
+
COALESCE_PAGE_SIZE = 200
|
|
24
29
|
COALESCE_PAGE_SIZE_RUN_RESULTS = 1_000
|
|
25
30
|
|
|
31
|
+
# raising this value might end up in remote server disconnection
|
|
26
32
|
COALESCE_TIMEOUT_SECONDS = 90
|
|
27
33
|
|
|
28
34
|
_MAX_ERRORS = 200
|
|
@@ -32,6 +38,10 @@ COALESCE_SAFE_MODE = RequestSafeMode(
|
|
|
32
38
|
max_errors=_MAX_ERRORS,
|
|
33
39
|
)
|
|
34
40
|
|
|
41
|
+
RETRY_COUNT = 1
|
|
42
|
+
RETRY_BASE_MS = 5 * 60 * 1000 # 5 minutes
|
|
43
|
+
RETRY_EXCEPTIONS = [ConnectTimeout, ReadTimeout]
|
|
44
|
+
|
|
35
45
|
|
|
36
46
|
def _run_result_payload(
|
|
37
47
|
environment_id: str,
|
|
@@ -64,6 +74,14 @@ class CoalesceBearerAuth(BearerAuth):
|
|
|
64
74
|
class CoalesceClient(APIClient):
|
|
65
75
|
"""REST API client to extract data from Coalesce"""
|
|
66
76
|
|
|
77
|
+
def test_connection(self) -> None:
|
|
78
|
+
endpoint = CoalesceEndpointFactory.environments()
|
|
79
|
+
request = self._get_paginated(endpoint=endpoint)
|
|
80
|
+
try:
|
|
81
|
+
next(fetch_all_pages(request, CoalescePagination))
|
|
82
|
+
except Exception as e:
|
|
83
|
+
raise TestConnectionException(e)
|
|
84
|
+
|
|
67
85
|
def __init__(
|
|
68
86
|
self,
|
|
69
87
|
credentials: CoalesceCredentials,
|
|
@@ -98,6 +116,11 @@ class CoalesceClient(APIClient):
|
|
|
98
116
|
result = fetch_all_pages(request, CoalescePagination)
|
|
99
117
|
return list(result)
|
|
100
118
|
|
|
119
|
+
@retry(
|
|
120
|
+
exceptions=RETRY_EXCEPTIONS,
|
|
121
|
+
max_retries=RETRY_COUNT,
|
|
122
|
+
base_ms=RETRY_BASE_MS,
|
|
123
|
+
)
|
|
101
124
|
def _fetch_env_nodes(self, environment_id: int) -> SerializedAsset:
|
|
102
125
|
endpoint = CoalesceEndpointFactory.nodes(environment_id=environment_id)
|
|
103
126
|
request = self._get_paginated(
|
|
@@ -192,7 +192,12 @@ class SigmaClient(APIClient):
|
|
|
192
192
|
)
|
|
193
193
|
queries = fetch_all_pages(request, SigmaPagination)
|
|
194
194
|
|
|
195
|
-
|
|
195
|
+
try:
|
|
196
|
+
yield from self._yield_deduplicated_queries(
|
|
197
|
+
queries, workbook_id
|
|
198
|
+
)
|
|
199
|
+
except ReadTimeout:
|
|
200
|
+
logger.warning(f"ReadTimeout for workbook {workbook_id}")
|
|
196
201
|
|
|
197
202
|
def _get_all_datamodel_sources(
|
|
198
203
|
self, datamodels: list[dict]
|
|
@@ -36,7 +36,8 @@ SELECT
|
|
|
36
36
|
t.created,
|
|
37
37
|
t.last_altered,
|
|
38
38
|
t.deleted,
|
|
39
|
-
ta.tags
|
|
39
|
+
ta.tags,
|
|
40
|
+
t.is_dynamic
|
|
40
41
|
FROM snowflake.account_usage.tables AS t
|
|
41
42
|
JOIN snowflake.account_usage.schemata AS s ON s.schema_id = t.table_schema_id
|
|
42
43
|
JOIN tags_agg_tables ta ON t.table_id = ta.table_id
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: castor-extractor
|
|
3
|
-
Version: 0.25.
|
|
3
|
+
Version: 0.25.14
|
|
4
4
|
Summary: Extract your metadata assets.
|
|
5
5
|
Home-page: https://www.castordoc.com/
|
|
6
6
|
License: EULA
|
|
@@ -37,7 +37,6 @@ Requires-Dist: google-api-core (>=2.1.1,<3.0.0)
|
|
|
37
37
|
Requires-Dist: google-api-python-client (>=2.121.0,<3.0.0) ; extra == "lookerstudio" or extra == "all"
|
|
38
38
|
Requires-Dist: google-auth (>=2,<3)
|
|
39
39
|
Requires-Dist: google-cloud-core (>=2.1.0,<3.0.0)
|
|
40
|
-
Requires-Dist: google-cloud-storage (>=3.1.0,<4.0.0)
|
|
41
40
|
Requires-Dist: google-resumable-media (>=2.0.3,<3.0.0)
|
|
42
41
|
Requires-Dist: googleapis-common-protos (>=1.53.0,<2.0.0)
|
|
43
42
|
Requires-Dist: looker-sdk (>=25.0.0,<26.0.0) ; extra == "looker" or extra == "all"
|
|
@@ -216,6 +215,24 @@ For any questions or bug report, contact us at [support@coalesce.io](mailto:supp
|
|
|
216
215
|
|
|
217
216
|
# Changelog
|
|
218
217
|
|
|
218
|
+
## 0.25.14 - 2025-10-28
|
|
219
|
+
|
|
220
|
+
* Removing unused dependency (google-cloud-storage)
|
|
221
|
+
|
|
222
|
+
## 0.25.13 - 2025-10-16
|
|
223
|
+
|
|
224
|
+
* Coalesce:
|
|
225
|
+
* reduce pagination
|
|
226
|
+
* retry once on ReadTimeout or ConnectionTimeout
|
|
227
|
+
|
|
228
|
+
## 0.25.12 - 2025-10-16
|
|
229
|
+
|
|
230
|
+
* Add a deprecation warning for Python versions below 3.10
|
|
231
|
+
|
|
232
|
+
## 0.25.11 - 2025-10-15
|
|
233
|
+
|
|
234
|
+
* Sigma: catch ReadTimeouts during queries extraction
|
|
235
|
+
|
|
219
236
|
## 0.25.10 - 2025-10-09
|
|
220
237
|
|
|
221
238
|
* Fix import
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
CHANGELOG.md,sha256
|
|
1
|
+
CHANGELOG.md,sha256=2pAjf3JtSe5AR2zTewGuKOHPXZebBAZ_vNdR_S14C1s,22246
|
|
2
2
|
Dockerfile,sha256=xQ05-CFfGShT3oUqaiumaldwA288dj9Yb_pxofQpufg,301
|
|
3
3
|
DockerfileUsage.md,sha256=2hkJQF-5JuuzfPZ7IOxgM6QgIQW7l-9oRMFVwyXC4gE,998
|
|
4
4
|
LICENCE,sha256=sL-IGa4hweyya1HgzMskrRdybbIa2cktzxb5qmUgDg8,8254
|
|
5
5
|
README.md,sha256=C6hTyZO60T7z7xwHbspHlii384Jn02k0Rycxu3bCX0o,3866
|
|
6
6
|
castor_extractor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
-
castor_extractor/commands/__init__.py,sha256=
|
|
7
|
+
castor_extractor/commands/__init__.py,sha256=3q18pP2jt0slwgrMkja-8vNq_GNk9-PZW6GPfqGQgxk,117
|
|
8
8
|
castor_extractor/commands/extract_bigquery.py,sha256=dU4OiYO1V0n32orvZnMh1_xtFKF_VxHNXcVsH3otY-g,1269
|
|
9
9
|
castor_extractor/commands/extract_confluence.py,sha256=blYcnDqywXNKRQ1aZAD9FclhLlO7x8Y_tb0lgl85v0w,1641
|
|
10
10
|
castor_extractor/commands/extract_count.py,sha256=cITp-2UmPYjbcICvYZzxE9oWieI8NbTH1DcWxLAZxJ4,611
|
|
@@ -31,7 +31,7 @@ castor_extractor/commands/extract_tableau.py,sha256=cfH-b0Hq9LGrQSJv02Yr_4d6oNqh
|
|
|
31
31
|
castor_extractor/commands/extract_thoughtspot.py,sha256=caAYJlH-vK7u5IUB6OKXxcaWfLgc7d_XqnFDWK6YNS4,639
|
|
32
32
|
castor_extractor/commands/file_check.py,sha256=TJx76Ymd0QCECmq35zRJMkPE8DJtSInB28MuSXWk8Ao,2644
|
|
33
33
|
castor_extractor/commands/upload.py,sha256=sqpEF_qqCNvT_niIrM6jPhzLaFVjtYwpc2iZw540F20,1633
|
|
34
|
-
castor_extractor/exceptions.py,sha256=
|
|
34
|
+
castor_extractor/exceptions.py,sha256=fhG5San5XzUr02XXEmCWs1_I_YS_cUji-E_G8_VYCsY,403
|
|
35
35
|
castor_extractor/file_checker/__init__.py,sha256=OSt6YLhUT42U_Cp3LCLHMVruwDkksL75Ij13X2UPnVk,119
|
|
36
36
|
castor_extractor/file_checker/column.py,sha256=6bJhcW1snYwgHKkqlS0Ak7XLHZr4YBwO46JCIlnQNKg,3086
|
|
37
37
|
castor_extractor/file_checker/column_test.py,sha256=1j8PxvmvmJgpd-mk30iMYOme32ovPSIn4yCXywFoXrg,1935
|
|
@@ -78,7 +78,7 @@ castor_extractor/transformation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm
|
|
|
78
78
|
castor_extractor/transformation/coalesce/__init__.py,sha256=CW_qdtEfwgJRsCyBlk5hNlxwEO-VV6mBXZvkRbND_J8,112
|
|
79
79
|
castor_extractor/transformation/coalesce/assets.py,sha256=pzccYPP66c9PAnVroemx7-6MeRHw7Ft1OlTC6jIamAA,363
|
|
80
80
|
castor_extractor/transformation/coalesce/client/__init__.py,sha256=VRmVpH29rOghtDQnCN7dAdA0dI0Lxseu4BC8rnwM9dU,80
|
|
81
|
-
castor_extractor/transformation/coalesce/client/client.py,sha256=
|
|
81
|
+
castor_extractor/transformation/coalesce/client/client.py,sha256=me9U6ovT4qR3AxTv9PN6fxG9UvPAdf7S9dvFDKVgFLY,6640
|
|
82
82
|
castor_extractor/transformation/coalesce/client/credentials.py,sha256=jbJxjbdPspf-dzYKfeb7oqL_8TXd1nvkJrjAcdAnLPc,548
|
|
83
83
|
castor_extractor/transformation/coalesce/client/endpoint.py,sha256=0uLh7dpA1vsR9qr_50SEYV_-heQE4BwED9oNMgYsL-w,1272
|
|
84
84
|
castor_extractor/transformation/coalesce/client/pagination.py,sha256=zynyWCMEzUQ7HA1Q5AP4BAOmxRQI6NA5jCPEo0lHn44,705
|
|
@@ -288,7 +288,7 @@ castor_extractor/visualization/sigma/__init__.py,sha256=GINql4yJLtjfOJgjHaWNpE13
|
|
|
288
288
|
castor_extractor/visualization/sigma/assets.py,sha256=iVZqi7XtNgSOVXy0jgeHZonVOeXi7jyikor8ztbECBc,398
|
|
289
289
|
castor_extractor/visualization/sigma/client/__init__.py,sha256=YQv06FBBQHvBMFg_tN0nUcmUp2NCL2s-eFTXG8rXaBg,74
|
|
290
290
|
castor_extractor/visualization/sigma/client/authentication.py,sha256=gHukrpfboIjZc_O9CcuDtrl6U-StH0J73VY2J74Bm9o,2279
|
|
291
|
-
castor_extractor/visualization/sigma/client/client.py,sha256=
|
|
291
|
+
castor_extractor/visualization/sigma/client/client.py,sha256=l2VlNktvtinRPR9RIIw8LlHRH-hhoycQlMG5HrQiIbc,9228
|
|
292
292
|
castor_extractor/visualization/sigma/client/client_test.py,sha256=ae0ZOvKutCm44jnrJ-0_A5Y6ZGyDkMf9Ml3eEP8dNkY,581
|
|
293
293
|
castor_extractor/visualization/sigma/client/credentials.py,sha256=XddAuQSmCKpxJ70TQgRnOj0vMPYVtiStk_lMMQ1AiNM,693
|
|
294
294
|
castor_extractor/visualization/sigma/client/endpoints.py,sha256=by9VIFml2whlzQT66f2m56RYBsqPrWdAmIP4JkTaBV4,1799
|
|
@@ -429,7 +429,7 @@ castor_extractor/warehouse/snowflake/queries/database.sql,sha256=yxHzV2oQfW0bo2d
|
|
|
429
429
|
castor_extractor/warehouse/snowflake/queries/function.sql,sha256=8LRh0ybhd-RldJ8UZspWUm3yv52evq11O2uqIO4KqeQ,372
|
|
430
430
|
castor_extractor/warehouse/snowflake/queries/query.sql,sha256=w4T6-TgwUozDgaF3Fk-qex7bDdEIHLkkB5XEe2VJXZQ,1992
|
|
431
431
|
castor_extractor/warehouse/snowflake/queries/schema.sql,sha256=iLn6_y5rn63KigjE4GEAMp8ZuZZofhMXYGb8saPDGUc,776
|
|
432
|
-
castor_extractor/warehouse/snowflake/queries/table.sql,sha256=
|
|
432
|
+
castor_extractor/warehouse/snowflake/queries/table.sql,sha256=ovZwQ5NqJB_IFggKfdeuMh2eCiptn4z-Ek6_1CFd1nU,1491
|
|
433
433
|
castor_extractor/warehouse/snowflake/queries/user.sql,sha256=88V8eRj1NDaD_ufclsKOHHlqCtBMQHOV54yy6RKJaXk,570
|
|
434
434
|
castor_extractor/warehouse/snowflake/queries/view_ddl.sql,sha256=eWsci_50cxiYIv3N7BKkbXVM3RoIzqSDtohqRnE5kg4,673
|
|
435
435
|
castor_extractor/warehouse/snowflake/query.py,sha256=C2LTdPwBzMQ_zMncg0Kq4_WkoY7K9as5tvxBDrIOlwI,1763
|
|
@@ -446,8 +446,8 @@ castor_extractor/warehouse/sqlserver/queries/user.sql,sha256=MAlnTis43E3Amu1e1Oz
|
|
|
446
446
|
castor_extractor/warehouse/sqlserver/queries/view_ddl.sql,sha256=9rynvx6MWg3iZzrWPB7haZfVKEPkxulzryE2g19x804,315
|
|
447
447
|
castor_extractor/warehouse/sqlserver/query.py,sha256=gr5lnZSUm-wSYuVnJlg6fc7jXWirbL-sCiQN9RnAiPQ,1789
|
|
448
448
|
castor_extractor/warehouse/synapse/queries/column.sql,sha256=lNcFoIW3Y0PFOqoOzJEXmPvZvfAsY0AP63Mu2LuPzPo,1351
|
|
449
|
-
castor_extractor-0.25.
|
|
450
|
-
castor_extractor-0.25.
|
|
451
|
-
castor_extractor-0.25.
|
|
452
|
-
castor_extractor-0.25.
|
|
453
|
-
castor_extractor-0.25.
|
|
449
|
+
castor_extractor-0.25.14.dist-info/LICENCE,sha256=sL-IGa4hweyya1HgzMskrRdybbIa2cktzxb5qmUgDg8,8254
|
|
450
|
+
castor_extractor-0.25.14.dist-info/METADATA,sha256=DTV_oWepOjhPFLkQ3XXf06lXcmmUaWCDSHz-PD68Hm0,29696
|
|
451
|
+
castor_extractor-0.25.14.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
452
|
+
castor_extractor-0.25.14.dist-info/entry_points.txt,sha256=qyTrKNByoq2HYi1xbA79OU7qxg-OWPvle8VwDqt-KnE,1869
|
|
453
|
+
castor_extractor-0.25.14.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|