castor-extractor 0.22.6__py3-none-any.whl → 0.23.1__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 CHANGED
@@ -1,11 +1,13 @@
1
-
2
1
  # Changelog
3
2
 
3
+ ## 0.23.1 - 2025-02-10
4
+
5
+ * change command for Confluence from password to token to reflect better their documentation
6
+
4
7
  ## 0.22.6 - 2025-01-21
5
8
 
6
9
  * bump dependencies: looker, databricks, deptry, ...
7
10
 
8
-
9
11
  ## 0.22.5 - 2025-01-09
10
12
 
11
13
  * Databricks: validate and deduplicate lineage links
@@ -13,7 +13,7 @@ def main():
13
13
  parser.add_argument("-a", "--account_id", help="Confluence account id")
14
14
  parser.add_argument("-b", "--base_url", help="Confluence account base url")
15
15
  parser.add_argument("-o", "--output", help="Directory to write to")
16
- parser.add_argument("-p", "--password", help="Confluence password")
16
+ parser.add_argument("-t", "--token", help="Confluence API token")
17
17
  parser.add_argument("-u", "--username", help="Confluence username")
18
18
 
19
19
  confluence.extract_all(**parse_filled_arguments(parser))
@@ -37,7 +37,7 @@ class ConfluenceClient(APIClient):
37
37
  ):
38
38
  self.account_id = credentials.account_id
39
39
  auth = BasicAuth(
40
- username=credentials.username, password=credentials.password
40
+ username=credentials.username, password=credentials.token
41
41
  )
42
42
  super().__init__(
43
43
  auth=auth,
@@ -14,5 +14,5 @@ class ConfluenceCredentials(BaseSettings):
14
14
 
15
15
  account_id: str
16
16
  base_url: str
17
- password: str
17
+ token: str
18
18
  username: str
@@ -11,7 +11,7 @@ from .endpoints import NotionEndpointFactory
11
11
  from .pagination import NotionPagination
12
12
 
13
13
  VOLUME_IGNORED = 10
14
- IGNORED_ERROR_CODES = (HTTPStatus.BAD_GATEWAY,)
14
+ IGNORED_ERROR_CODES = (HTTPStatus.BAD_GATEWAY, HTTPStatus.NOT_FOUND)
15
15
  NOTION_SAFE_MODE = RequestSafeMode(
16
16
  max_errors=VOLUME_IGNORED,
17
17
  status_codes=IGNORED_ERROR_CODES,
@@ -37,10 +37,10 @@ def test_validate_baseurl():
37
37
  validate_baseurl("")
38
38
 
39
39
  with pytest.raises(ValueError):
40
- validate_baseurl("ftp://tesla.looker.eu")
40
+ validate_baseurl("ftp://timber.looker.eu")
41
41
 
42
42
  with pytest.raises(ValueError):
43
- validate_baseurl("https://tesla.looker.eu:19999?query=params")
43
+ validate_baseurl("https://timber.looker.eu:19999?query=params")
44
44
 
45
45
  with pytest.raises(ValueError):
46
- validate_baseurl("https://tesla.looker.eu:19999#fragment")
46
+ validate_baseurl("https://timber.looker.eu:19999#fragment")
@@ -1,4 +1,6 @@
1
+ from contextlib import contextmanager
1
2
  from functools import partial
3
+ from http import HTTPStatus
2
4
  from typing import Iterator, Optional
3
5
 
4
6
  from google.auth.transport.requests import Request
@@ -7,6 +9,7 @@ from google.oauth2.service_account import Credentials
7
9
  from ....utils import (
8
10
  APIClient,
9
11
  BearerAuth,
12
+ RequestSafeMode,
10
13
  fetch_all_pages,
11
14
  )
12
15
  from .credentials import LookerStudioCredentials
@@ -16,6 +19,22 @@ from .pagination import LookerStudioPagination
16
19
  from .scopes import SCOPES
17
20
 
18
21
 
22
+ @contextmanager
23
+ def temporary_safe_request(client: APIClient):
24
+ """
25
+ Allows applying the safe mode only to specific requests instead of all
26
+ API calls.
27
+ """
28
+ client._safe_mode = RequestSafeMode(
29
+ max_errors=float("inf"),
30
+ status_codes=(HTTPStatus.UNAUTHORIZED,),
31
+ )
32
+ try:
33
+ yield client
34
+ finally:
35
+ client._safe_mode = RequestSafeMode()
36
+
37
+
19
38
  class LookerStudioAPIAuth(BearerAuth):
20
39
  def __init__(
21
40
  self,
@@ -56,9 +75,14 @@ class LookerStudioAPIClient(APIClient):
56
75
 
57
76
  See also https://developers.google.com/looker-studio/integrate/api/reference/types#Permissions
58
77
  """
59
- data = self._get(LookerStudioAPIEndpoint.permissions(asset_name))
60
- permissions = data["permissions"]
61
- return len(permissions.keys()) == 1
78
+ with temporary_safe_request(self):
79
+ data = self._get(LookerStudioAPIEndpoint.permissions(asset_name))
80
+ permissions = data.get("permissions")
81
+
82
+ if not permissions:
83
+ return True
84
+
85
+ return len(permissions.keys()) == 1
62
86
 
63
87
  def _user_assets(
64
88
  self, asset_type: LookerStudioAssetType, user_email: str
@@ -76,7 +100,7 @@ class LookerStudioAPIClient(APIClient):
76
100
 
77
101
  for asset in assets:
78
102
  asset_name = asset["name"]
79
- owner = asset["owner"]
103
+ owner = asset.get("owner", "")
80
104
  if owner == user_email and not self._is_private_asset(asset_name):
81
105
  yield asset
82
106
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: castor-extractor
3
- Version: 0.22.6
3
+ Version: 0.23.1
4
4
  Summary: Extract your metadata assets.
5
5
  Home-page: https://www.castordoc.com/
6
6
  License: EULA
@@ -30,7 +30,7 @@ Provides-Extra: snowflake
30
30
  Provides-Extra: sqlserver
31
31
  Provides-Extra: tableau
32
32
  Requires-Dist: cryptography (>=43.0.0,<44.0.0) ; extra == "snowflake"
33
- Requires-Dist: databricks-sql-connector (>=3.2.0,<4.0.0) ; extra == "databricks" or extra == "all"
33
+ Requires-Dist: databricks-sql-connector (==3.6.0) ; extra == "databricks" or extra == "all"
34
34
  Requires-Dist: google-api-core (>=2.1.1,<3.0.0)
35
35
  Requires-Dist: google-api-python-client (>=2.121.0,<3.0.0) ; extra == "lookerstudio" or extra == "all"
36
36
  Requires-Dist: google-auth (>=2,<3)
@@ -204,14 +204,16 @@ For any questions or bug report, contact us at [support@castordoc.com](mailto:su
204
204
 
205
205
  [Castor](https://castordoc.com) helps you find, understand, use your data assets
206
206
 
207
-
208
207
  # Changelog
209
208
 
209
+ ## 0.23.1 - 2025-02-10
210
+
211
+ * change command for Confluence from password to token to reflect better their documentation
212
+
210
213
  ## 0.22.6 - 2025-01-21
211
214
 
212
215
  * bump dependencies: looker, databricks, deptry, ...
213
216
 
214
-
215
217
  ## 0.22.5 - 2025-01-09
216
218
 
217
219
  * Databricks: validate and deduplicate lineage links
@@ -1,4 +1,4 @@
1
- CHANGELOG.md,sha256=NINE1E6fLk7AivCkBrN79ea93u3F3bwlZzvn8xvwSbM,15414
1
+ CHANGELOG.md,sha256=uItbpd54X3IEvlXwXFbSLqCgkY3lwgOoNrhIu_VaJk8,15530
2
2
  Dockerfile,sha256=xQ05-CFfGShT3oUqaiumaldwA288dj9Yb_pxofQpufg,301
3
3
  DockerfileUsage.md,sha256=2hkJQF-5JuuzfPZ7IOxgM6QgIQW7l-9oRMFVwyXC4gE,998
4
4
  LICENCE,sha256=sL-IGa4hweyya1HgzMskrRdybbIa2cktzxb5qmUgDg8,8254
@@ -6,7 +6,7 @@ README.md,sha256=uF6PXm9ocPITlKVSh9afTakHmpLx3TvawLf-CbMP3wM,3578
6
6
  castor_extractor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  castor_extractor/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  castor_extractor/commands/extract_bigquery.py,sha256=dU4OiYO1V0n32orvZnMh1_xtFKF_VxHNXcVsH3otY-g,1269
9
- castor_extractor/commands/extract_confluence.py,sha256=o4vjN7nxN2MQWyLgdgjbaO9Rd53f2icYst5tv_evwT4,750
9
+ castor_extractor/commands/extract_confluence.py,sha256=xQjC0VZdz8jFHnugqQ0fQGjzGq34v49cqcP4ONeVYNs,748
10
10
  castor_extractor/commands/extract_databricks.py,sha256=SVKyoa-BBUQAM6HRHf1Wdg9-tpICic2yyvXQwHcNBhA,1264
11
11
  castor_extractor/commands/extract_domo.py,sha256=jvAawUsUTHrwCn_koK6StmQr4n_b5GyvJi6uu6WS0SM,1061
12
12
  castor_extractor/commands/extract_looker.py,sha256=cySLiolLCgrREJ9d0kMrJ7P8K3efHTBTzShalWVfI3A,1214
@@ -43,15 +43,15 @@ castor_extractor/knowledge/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
43
43
  castor_extractor/knowledge/confluence/__init__.py,sha256=pRT615pMDlB7Ifs09erVn2EdpZHgkvX5selemWU3VPE,129
44
44
  castor_extractor/knowledge/confluence/assets.py,sha256=zv2G2LB8H0fKDbVJ4kHrAjbqehXI_K-wgd_ghSXGFvs,144
45
45
  castor_extractor/knowledge/confluence/client/__init__.py,sha256=ALAzo0JEhxFzH2FnIO6HmtkAGS2_bGY8KXXMcTGV3aE,84
46
- castor_extractor/knowledge/confluence/client/client.py,sha256=rr0PsBkV3jMDK2yUNnEfGKp0ZsxClD8wJ2rUiUfAAFY,2117
47
- castor_extractor/knowledge/confluence/client/credentials.py,sha256=2LUjnCOMwq2NBrkHty99TpWlgyOOsYjwC9NeekZMH84,422
46
+ castor_extractor/knowledge/confluence/client/client.py,sha256=lGLRBbAOkEXcEKwHwdBhgG5cvAUkzpSL-7pPcmZpsE8,2114
47
+ castor_extractor/knowledge/confluence/client/credentials.py,sha256=tqUMw-SVoAi4o6I6OeGk4MeDiIPU3-ihhaomXv4CQ64,419
48
48
  castor_extractor/knowledge/confluence/client/endpoints.py,sha256=b7PIvw9_W942L4zsEZa__KhZDTo4yt-CdIO0eas69TE,736
49
49
  castor_extractor/knowledge/confluence/client/pagination.py,sha256=ty4meiMEujDVSiQyOJTibd-ReYyDyGezdFuk7EAGtMA,862
50
50
  castor_extractor/knowledge/confluence/extract.py,sha256=6pA68CmYNC50qCJ7NgZMW0jD4ev0a_ltI5kSyBqSC0U,1565
51
51
  castor_extractor/knowledge/notion/__init__.py,sha256=ZDmh0eNSxHf1zVPm0aYlKPci-vzOXhAgdsWjS2hdjh4,117
52
52
  castor_extractor/knowledge/notion/assets.py,sha256=QHv1-pomt5UeN_prP2L6t_zJ-tDSqB8LgopkGAODYPQ,164
53
53
  castor_extractor/knowledge/notion/client/__init__.py,sha256=CDPorBCethuNTEtpjvHGcWnWeVfqkEq-IbakWjDKATw,76
54
- castor_extractor/knowledge/notion/client/client.py,sha256=xRPyxTiyRN8vc2w1kGniyK_7zUgcW1z0Ht4aoNZO6fg,3706
54
+ castor_extractor/knowledge/notion/client/client.py,sha256=fUjdmQXVBA0Dn75s10-umjCovEavXt_qAdiXjUuYizM,3727
55
55
  castor_extractor/knowledge/notion/client/client_test.py,sha256=fo3_WgCIUfeF3nMfHTSB6wjxIW_dHp1XZL41tNzBisQ,1976
56
56
  castor_extractor/knowledge/notion/client/constants.py,sha256=dZCpSrxFlLbR_cFPJKz4M5wcMVcY4UfWFG0N5S22Fhw,147
57
57
  castor_extractor/knowledge/notion/client/credentials.py,sha256=-mBY6IhAb9z2RP1MilzIyS3BW39J__u_M5n9uIuUlxA,398
@@ -139,7 +139,7 @@ castor_extractor/utils/time.py,sha256=jmP1QWg4lv21Jp_Oy71lfJ47hjNOSgHiBOFf964RMP
139
139
  castor_extractor/utils/time_test.py,sha256=pH8DSosNlwDYZXZNNjYDcL0WbmZc_c212LEEn88Oqew,647
140
140
  castor_extractor/utils/type.py,sha256=Sd8JlEgbGkBUZnRqCUDtREeBkOMTXtlNMyCph90_J0Q,328
141
141
  castor_extractor/utils/validation.py,sha256=kQAFtqt3gfy7YqYQ0u-60vyNYUF_96he5QDVUQnZmDo,1896
142
- castor_extractor/utils/validation_test.py,sha256=aSetitOCkH_K-Wto9ISOVGso5jGfTUOBLm3AZnvavO8,1181
142
+ castor_extractor/utils/validation_test.py,sha256=A7P6VmI0kYX2aGIeEN12y7LsY7Kpm8pE4bdVFhbBAMw,1184
143
143
  castor_extractor/utils/write.py,sha256=Z_RYm47XeHiUPPUMYMuAjQrVZ18CAkL3daQHQG1XPlM,2148
144
144
  castor_extractor/visualization/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
145
145
  castor_extractor/visualization/domo/__init__.py,sha256=1axOCPm4RpdIyUt9LQEvlMvbOPllW8rk63h6EjVgJ0Y,111
@@ -176,7 +176,7 @@ castor_extractor/visualization/looker_studio/client/client.py,sha256=AYdR46NOdn_
176
176
  castor_extractor/visualization/looker_studio/client/credentials.py,sha256=yzTaiJQ5cArTnbybUPF6fZZXbX9XQ0SBq-jVI2ECovA,521
177
177
  castor_extractor/visualization/looker_studio/client/endpoints.py,sha256=5eY-ffqNDdlDBOOpiF7LpjyHMrzeClJktidCr1pTDUs,669
178
178
  castor_extractor/visualization/looker_studio/client/enums.py,sha256=fHgemTaQpnwee8cw1YQVDsVnH--vTyFwT4Px8aVYYHQ,167
179
- castor_extractor/visualization/looker_studio/client/looker_studio_api_client.py,sha256=Oqu_bGBEqYRR_aitBFyvfCZnx0kSZf4qGEI16tIRnhw,3482
179
+ castor_extractor/visualization/looker_studio/client/looker_studio_api_client.py,sha256=oySC6rsppj67RSifxwSCw4bFrz1Irx6IFJhX7tc_v1E,4087
180
180
  castor_extractor/visualization/looker_studio/client/pagination.py,sha256=9HQ3Rkdiz2VB6AvYtZ0F-WouiD0pMmdZyAmkv-3wh08,783
181
181
  castor_extractor/visualization/looker_studio/client/scopes.py,sha256=824cqqgZuGq4L-rPNoHJe0ibXsxkRwB0CLG_kqw9Q0g,256
182
182
  castor_extractor/visualization/metabase/__init__.py,sha256=3E36cmkMyEgBB6Ot5rWk-N75i0G-7k24QTlc-Iol4pM,193
@@ -436,8 +436,8 @@ castor_extractor/warehouse/sqlserver/queries/table.sql,sha256=kbBQP-TdG5px1IVgyx
436
436
  castor_extractor/warehouse/sqlserver/queries/user.sql,sha256=gOrZsMVypusR2dc4vwVs4E1a-CliRsr_UjnD2EbXs-A,94
437
437
  castor_extractor/warehouse/sqlserver/query.py,sha256=g0hPT-RmeGi2DyenAi3o72cTlQsLToXIFYojqc8E5fQ,533
438
438
  castor_extractor/warehouse/synapse/queries/column.sql,sha256=lNcFoIW3Y0PFOqoOzJEXmPvZvfAsY0AP63Mu2LuPzPo,1351
439
- castor_extractor-0.22.6.dist-info/LICENCE,sha256=sL-IGa4hweyya1HgzMskrRdybbIa2cktzxb5qmUgDg8,8254
440
- castor_extractor-0.22.6.dist-info/METADATA,sha256=CygRIOqL2H1YeiwzeQElCbImi8qEBLfwXyVTqA4m5kE,22437
441
- castor_extractor-0.22.6.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
442
- castor_extractor-0.22.6.dist-info/entry_points.txt,sha256=7aVSxc-_2dicp28Ow-S4y0p4wGoTm9zGmVptMvfLdw8,1649
443
- castor_extractor-0.22.6.dist-info/RECORD,,
439
+ castor_extractor-0.23.1.dist-info/LICENCE,sha256=sL-IGa4hweyya1HgzMskrRdybbIa2cktzxb5qmUgDg8,8254
440
+ castor_extractor-0.23.1.dist-info/METADATA,sha256=6yGEAuCwBKELYaRnIf8hZAXsJMOAlJqPlJiNYWhEmok,22546
441
+ castor_extractor-0.23.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
442
+ castor_extractor-0.23.1.dist-info/entry_points.txt,sha256=7aVSxc-_2dicp28Ow-S4y0p4wGoTm9zGmVptMvfLdw8,1649
443
+ castor_extractor-0.23.1.dist-info/RECORD,,