castor-extractor 0.19.4__py3-none-any.whl → 0.19.7__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.

Files changed (40) hide show
  1. CHANGELOG.md +13 -0
  2. castor_extractor/quality/soda/client/pagination.py +1 -1
  3. castor_extractor/utils/__init__.py +1 -0
  4. castor_extractor/utils/client/__init__.py +1 -1
  5. castor_extractor/utils/client/api/__init__.py +1 -1
  6. castor_extractor/utils/client/api/client.py +33 -7
  7. castor_extractor/utils/client/api/pagination.py +23 -6
  8. castor_extractor/utils/pager/__init__.py +0 -1
  9. castor_extractor/utils/salesforce/client.py +45 -50
  10. castor_extractor/utils/salesforce/client_test.py +2 -2
  11. castor_extractor/utils/salesforce/pagination.py +33 -0
  12. castor_extractor/visualization/metabase/client/api/client.py +30 -11
  13. castor_extractor/visualization/salesforce_reporting/client/rest.py +4 -3
  14. castor_extractor/visualization/sigma/client/client.py +2 -1
  15. castor_extractor/visualization/tableau_revamp/assets.py +8 -0
  16. castor_extractor/visualization/tableau_revamp/client/client.py +6 -1
  17. castor_extractor/warehouse/databricks/api_client.py +239 -0
  18. castor_extractor/warehouse/databricks/api_client_test.py +15 -0
  19. castor_extractor/warehouse/databricks/client.py +37 -489
  20. castor_extractor/warehouse/databricks/client_test.py +1 -99
  21. castor_extractor/warehouse/databricks/endpoints.py +28 -0
  22. castor_extractor/warehouse/databricks/lineage.py +141 -0
  23. castor_extractor/warehouse/databricks/lineage_test.py +34 -0
  24. castor_extractor/warehouse/databricks/pagination.py +22 -0
  25. castor_extractor/warehouse/databricks/sql_client.py +90 -0
  26. castor_extractor/warehouse/databricks/utils.py +44 -1
  27. castor_extractor/warehouse/databricks/utils_test.py +58 -1
  28. castor_extractor/warehouse/mysql/client.py +0 -3
  29. castor_extractor/warehouse/salesforce/client.py +12 -59
  30. castor_extractor/warehouse/salesforce/pagination.py +34 -0
  31. castor_extractor/warehouse/sqlserver/client.py +0 -2
  32. {castor_extractor-0.19.4.dist-info → castor_extractor-0.19.7.dist-info}/METADATA +14 -1
  33. {castor_extractor-0.19.4.dist-info → castor_extractor-0.19.7.dist-info}/RECORD +36 -31
  34. castor_extractor/utils/client/api_deprecated.py +0 -89
  35. castor_extractor/utils/client/api_deprecated_test.py +0 -18
  36. castor_extractor/utils/pager/pager_on_token.py +0 -52
  37. castor_extractor/utils/pager/pager_on_token_test.py +0 -73
  38. {castor_extractor-0.19.4.dist-info → castor_extractor-0.19.7.dist-info}/LICENCE +0 -0
  39. {castor_extractor-0.19.4.dist-info → castor_extractor-0.19.7.dist-info}/WHEEL +0 -0
  40. {castor_extractor-0.19.4.dist-info → castor_extractor-0.19.7.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,34 @@
1
+ from typing import Optional
2
+
3
+ from ...utils import PaginationModel
4
+ from ...utils.salesforce.pagination import LIMIT_RECORDS_PER_PAGE
5
+ from .soql import (
6
+ SOBJECTS_QUERY_TPL,
7
+ )
8
+
9
+ # Implicit (hard-coded in Salesforce) limitation when using SOQL of 2,000 rows
10
+ FIRST_START_DURABLE_ID = "0000"
11
+
12
+
13
+ def format_sobject_query(
14
+ start_durable_id: str = FIRST_START_DURABLE_ID,
15
+ ) -> str:
16
+ return SOBJECTS_QUERY_TPL.format(
17
+ start_durable_id=start_durable_id,
18
+ limit=LIMIT_RECORDS_PER_PAGE,
19
+ )
20
+
21
+
22
+ class SalesforceSQLPagination(PaginationModel):
23
+ records: list
24
+
25
+ def next_page_payload(self) -> Optional[dict]:
26
+ start_durable_id = self.records[-1]["DurableId"]
27
+ query = format_sobject_query(start_durable_id)
28
+ return {"q": query}
29
+
30
+ def is_last(self) -> bool:
31
+ return len(self.records) < LIMIT_RECORDS_PER_PAGE
32
+
33
+ def page_results(self) -> list:
34
+ return self.records
@@ -1,7 +1,5 @@
1
1
  from typing import Iterator
2
2
 
3
- # this import is necessary so deptry does not mark the package as unused
4
- import pymssql # type: ignore # noqa: F401
5
3
  from sqlalchemy import text
6
4
 
7
5
  from ...utils import ExtractionQuery, SqlalchemyClient, uri_encode
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: castor-extractor
3
- Version: 0.19.4
3
+ Version: 0.19.7
4
4
  Summary: Extract your metadata assets.
5
5
  Home-page: https://www.castordoc.com/
6
6
  License: EULA
@@ -205,8 +205,21 @@ For any questions or bug report, contact us at [support@castordoc.com](mailto:su
205
205
 
206
206
  [Castor](https://castordoc.com) helps you find, understand, use your data assets
207
207
 
208
+
208
209
  # Changelog
209
210
 
211
+ ## 0.19.7 - 2024-09-05
212
+
213
+ * Metabase: Handle compatibility with older version
214
+
215
+ ## 0.19.6 - 2024-09-03
216
+
217
+ * Metabase: Adding error handler on API call
218
+
219
+ ## 0.19.5 - 2024-09-02
220
+
221
+ * Databricks/Salesforce: Remove deprecated client dependencies
222
+
210
223
  ## 0.19.4 - 2024-08-29
211
224
 
212
225
  * Tableau Pulse: extract Metrics and Subscriptions
@@ -1,4 +1,4 @@
1
- CHANGELOG.md,sha256=4sBzpYnhl78o74iaaYnUXX2JJJ_1wHUodGcVGLkl3Ag,13057
1
+ CHANGELOG.md,sha256=cJ5aAA_dulThT10jAw6hHkBGiDyrZFqN7S_78E3q1Qk,13293
2
2
  Dockerfile,sha256=HcX5z8OpeSvkScQsN-Y7CNMUig_UB6vTMDl7uqzuLGE,303
3
3
  DockerfileUsage.md,sha256=2hkJQF-5JuuzfPZ7IOxgM6QgIQW7l-9oRMFVwyXC4gE,998
4
4
  LICENCE,sha256=sL-IGa4hweyya1HgzMskrRdybbIa2cktzxb5qmUgDg8,8254
@@ -56,7 +56,7 @@ castor_extractor/quality/soda/client/__init__.py,sha256=LUvHHyyL2t3mk5GORshnef4F
56
56
  castor_extractor/quality/soda/client/client.py,sha256=8JEnLJn4-m_km-JyJaq-9RNpqBxwErVDIEgYpRju5QA,1509
57
57
  castor_extractor/quality/soda/client/credentials.py,sha256=yVFIYeEv76LogOwP_JEWieRpRFyOtACj7VLhSjyPH5k,426
58
58
  castor_extractor/quality/soda/client/endpoints.py,sha256=x3B-XlnDF8NJMuk-81N72_6HA-YZEzA895khLyj0j54,228
59
- castor_extractor/quality/soda/client/pagination.py,sha256=HdL9gmQyURlRVl2MsjbqH_qKFhBIdskcTb5W0EwcPMI,583
59
+ castor_extractor/quality/soda/client/pagination.py,sha256=KgCNdLLX-G9SSnNuTslw5rh7Llwl_4LDmJEuf2ylm_A,604
60
60
  castor_extractor/types.py,sha256=Hd_shbsGAknJLTrAk3SBxZeFPOlbWBXXjIscC9C7CW8,1281
61
61
  castor_extractor/uploader/__init__.py,sha256=SSRtwjg-dNoxME-RJy9G1flASiUKAC5bH1htq3CURQg,75
62
62
  castor_extractor/uploader/constant.py,sha256=yTigLHDlYwoRr6CpFIl7ReElFsQd4H-qkluMZJPWSx0,865
@@ -65,24 +65,22 @@ castor_extractor/uploader/env_test.py,sha256=ClCWWtwd2N-5ClIDUxVMeKkWfhhOTxpppsX
65
65
  castor_extractor/uploader/upload.py,sha256=c86NP4ZxWnz3Hy1iWDYd9qjJSSjZ1bLq3fxVGBIU4Rc,3238
66
66
  castor_extractor/uploader/upload_test.py,sha256=7fwstdQe7FjuwGilsCdFpEQr1qLoR2WTRUzyy93fISw,402
67
67
  castor_extractor/uploader/utils.py,sha256=Tx_i875L2vJ8btOLV3-L0UMEFiyhH8E5n0XXRyLjO0Y,793
68
- castor_extractor/utils/__init__.py,sha256=YIM4iPH9N6_R1CSt5bq7LYJoMFRJjz-NUa6F2LTnmaE,1488
68
+ castor_extractor/utils/__init__.py,sha256=MReSpH6I4AQZ5WTQp752P2sP4wVVZO8MyyglN0K0VKw,1509
69
69
  castor_extractor/utils/argument_parser.py,sha256=S4EcIh3wNDjs3fOrQnttCcPsAmG8m_Txl7xvEh0Q37s,283
70
70
  castor_extractor/utils/argument_parser_test.py,sha256=wnyLFJ74iEiPxxLSbwFtckR7FIHxsFOVU38ljs9gqRA,633
71
- castor_extractor/utils/client/__init__.py,sha256=wvzi8AjuDmPjseafLRDJvWFjWDvwNOIYelzzphEO--Q,419
71
+ castor_extractor/utils/client/__init__.py,sha256=h5gm8UNNCCkAqhjYK5f6BY7k0cHFOyAvkmlktqwpir0,392
72
72
  castor_extractor/utils/client/abstract.py,sha256=aA5Qcb9TwWDSMq8WpXbGkOB20hehwX2VTpqQAwV76wk,2048
73
- castor_extractor/utils/client/api/__init__.py,sha256=TuFJ6D9zfx_FtAWQwWf20V-3JqIHB6EHygqVV74oRrA,247
73
+ castor_extractor/utils/client/api/__init__.py,sha256=vlG7WXznYgLTn3XyMGsyUkgRkup8FbKM14EXJ8mv-b0,264
74
74
  castor_extractor/utils/client/api/auth.py,sha256=QDLM5h1zGibLaKyATxLF0gycg01SE92G-Y69f_YBClc,1896
75
75
  castor_extractor/utils/client/api/auth_test.py,sha256=NoZYsz7bcCyWBZdMF1TaOuK-s1j09DhTRyM4GSUW_YQ,1311
76
- castor_extractor/utils/client/api/client.py,sha256=eMWj_JMusXSEDoixdSil6nr9j3OQNS68Eoz8QbfKmRM,3658
76
+ castor_extractor/utils/client/api/client.py,sha256=h8cQZ4CSD0LUuNv1VC5qa_p_jFbiOUbYztJnNmpJa2Q,4231
77
77
  castor_extractor/utils/client/api/client_test.py,sha256=FM3ZxsLLfMOBn44cXX6FIgnA31-5TTNIyp9D4LBwtXE,1222
78
- castor_extractor/utils/client/api/pagination.py,sha256=7uPHdCujhdBf_CmLqgs6AsQ-8wrqORsXvO_AYrdoboY,1921
78
+ castor_extractor/utils/client/api/pagination.py,sha256=Ne-4dqKrwEAETheBn14KPrGRzxsrkuCO96Z6gkCI-0Y,2437
79
79
  castor_extractor/utils/client/api/pagination_test.py,sha256=jCOgXFXrH-jrCxe2dfk80ZksJF-EtmpJPU11BGabsqk,1385
80
80
  castor_extractor/utils/client/api/safe_request.py,sha256=SeBteAK8KhBjXldIdyUpkZphf9ktjzbvBM49AXrvD0g,1686
81
81
  castor_extractor/utils/client/api/safe_request_test.py,sha256=LqS5FBxs6lLLcTkcgxIoLb6OinxShHXR5y4CWZpwmwg,2005
82
82
  castor_extractor/utils/client/api/utils.py,sha256=jr8CWf48cIp8QP1P7oZ1zg9WaGlDO3mqCWgQKdEcpyc,238
83
83
  castor_extractor/utils/client/api/utils_test.py,sha256=a5aL-pCwa74C8Ne7OT169Bjp8WPDV5Fl8MxNxAllHJg,514
84
- castor_extractor/utils/client/api_deprecated.py,sha256=3yPXld2yQPbwPe1RKhXU9MV9iwWCQ85zMR23A66xQAM,2418
85
- castor_extractor/utils/client/api_deprecated_test.py,sha256=uOmY7M62bmDBzINor5OcxVeZktI0LthVeTD6NxjGtUo,607
86
84
  castor_extractor/utils/client/postgres.py,sha256=n6ulaT222WWPY0_6qAZ0MHF0m91HtI9mMqL71nyygo0,866
87
85
  castor_extractor/utils/client/query.py,sha256=O6D5EjD1KmBlwa786Uw4D4kzxx97_HH50xIIeSWt0B8,205
88
86
  castor_extractor/utils/client/uri.py,sha256=jmP9hY-6PRqdc3-vAOdtll_U6q9VCqSqmBAN6QRs3ZI,150
@@ -107,23 +105,22 @@ castor_extractor/utils/json_stream_write.py,sha256=OUdg4-47I47pgbpN9_a6y-lmxuod7
107
105
  castor_extractor/utils/load.py,sha256=MXwGVB_Dp_VitGwo71sNB_xDmGzQ4oQ13MhaXXyYkS0,265
108
106
  castor_extractor/utils/object.py,sha256=xCcQtoj9313TCcoyRXkLpDcMxmDeQMFMseDNx95oGc0,1959
109
107
  castor_extractor/utils/object_test.py,sha256=uy8p1VTtJX5Q1AhpORRlx7rM6vLuhnW0Gb3fprBIlG8,2487
110
- castor_extractor/utils/pager/__init__.py,sha256=IoZnJVkALgEAg5P_fiecrPbukLFsKT8AmL7qA8mov0g,165
108
+ castor_extractor/utils/pager/__init__.py,sha256=whWh-Kr524ELXrukzorPWo-7ugEPJTcn-vzb9F096J8,124
111
109
  castor_extractor/utils/pager/pager.py,sha256=h_toZkR6RbXh-rdbAKule86bVijEqriV3GMnMTpCYIM,2389
112
110
  castor_extractor/utils/pager/pager_on_id.py,sha256=WATgZcZ2_1W2v1IbkwKIwjw2paoimm8r-ZJiNtPVc5w,1940
113
111
  castor_extractor/utils/pager/pager_on_id_test.py,sha256=CfAXhXaAmCXnm0oflj8_82An6znOS2mBk4nqvtrCqs4,1613
114
- castor_extractor/utils/pager/pager_on_token.py,sha256=G442SKl4BXJFMPbYIIgCk5M8wl7V3jMg3K1WUUkl0I0,1579
115
- castor_extractor/utils/pager/pager_on_token_test.py,sha256=w2GCUGKR3cD5lfmtFAsNvExtzxkYdBR0pusBrGKFQ08,2548
116
112
  castor_extractor/utils/pager/pager_test.py,sha256=QPBVShSXhkiYZUfnAMs43xnys6CD8pAhL3Jhj-Ov2Xc,1705
117
113
  castor_extractor/utils/retry.py,sha256=pTCASEtKjSBPwS5ummaCF_C0rZcQwEhOPYRQi0PpDG0,4719
118
114
  castor_extractor/utils/retry_test.py,sha256=YMZfiEy95FQHsp8StPDAHfMvljIl-nLNpAjwRFh91KA,2916
119
115
  castor_extractor/utils/safe.py,sha256=jpfIimwdBSVUvU2DPFrhqpKC_DSYwxQqd08MlIkSODY,1967
120
116
  castor_extractor/utils/safe_test.py,sha256=IHN1Z761tYMFslYC-2HAfkXmFPh4LYSqNLs4QZwykjk,2160
121
117
  castor_extractor/utils/salesforce/__init__.py,sha256=fZ2U6t6AFFAIC-DLXvFHBgpBDjTvX0tFgZ8zJoehPAc,88
122
- castor_extractor/utils/salesforce/client.py,sha256=nvNikpuQAJJPRnpARKeeFzUK0MbPCf8XRAKlFev-tgQ,2877
123
- castor_extractor/utils/salesforce/client_test.py,sha256=s6UTogjC36jrJOnYA-gFuyTQsvROCt9y_eoD2O41xCg,682
118
+ castor_extractor/utils/salesforce/client.py,sha256=aX_iWQFWdhk8gh16_gSHYeCI9A7wqohcQhY-DOEWKko,2350
119
+ castor_extractor/utils/salesforce/client_test.py,sha256=T3gUnZ0cRvnL_4dVc4lInRSO9Ti2WeLkLWV1scps4IY,668
124
120
  castor_extractor/utils/salesforce/constants.py,sha256=7yPmUeyn4IHQiHLDutXE0L_OBd41E5080vFxqA_s4Dc,58
125
121
  castor_extractor/utils/salesforce/credentials.py,sha256=Fp-7yaidGpeuaXad1ng6dr1jSOI9Bl2KMVZXPyTBVjM,1148
126
122
  castor_extractor/utils/salesforce/credentials_test.py,sha256=FQRyNk2Jsh6KtYiW20oL43CVnGjXLcAjdFATkE7jK0s,586
123
+ castor_extractor/utils/salesforce/pagination.py,sha256=wJq0rKLdacFRggyHwB6Fh3K6iXPvL4QWhsDvZdjQjM8,849
127
124
  castor_extractor/utils/store.py,sha256=D_pVaPsu1MKAJC0K47O_vYTs-Afl6oejravAJdvjmGc,2040
128
125
  castor_extractor/utils/string.py,sha256=aW6bbjqEGnh9kT5KZBnMlV6fhdgOJ0ENCkCTDon1xA0,2377
129
126
  castor_extractor/utils/string_test.py,sha256=QWuNog77GogQsPI5kSXLskq6z3Obt89YbugWEia6PH4,2527
@@ -164,7 +161,7 @@ castor_extractor/visualization/metabase/__init__.py,sha256=3E36cmkMyEgBB6Ot5rWk-
164
161
  castor_extractor/visualization/metabase/assets.py,sha256=RrrE7H0ezqD-YpNLjDOo4u5fFPUK1PIRxLXNERFqFn8,2906
165
162
  castor_extractor/visualization/metabase/client/__init__.py,sha256=KBvaPMofBRV3m_sZAnKNCrJGr-Z88EbpdzEzWPQ_uBk,99
166
163
  castor_extractor/visualization/metabase/client/api/__init__.py,sha256=BYSPWHY4KbT-LvenNI0pRonxolzZ5HSl6v3-PbJr-7M,78
167
- castor_extractor/visualization/metabase/client/api/client.py,sha256=sQIROc8lKEEUs496Qhi_Uvk9YV1Is4klqmn6Etvudbs,5935
164
+ castor_extractor/visualization/metabase/client/api/client.py,sha256=2b8NUBjVev-DcMG-rshCPGbG4673NRgjgseUy46JI5M,6460
168
165
  castor_extractor/visualization/metabase/client/api/client_test.py,sha256=7Lb5yvrvHQmCIOnFzS2D00oR2Zps1SVxGIAukzRVeKg,559
169
166
  castor_extractor/visualization/metabase/client/api/credentials.py,sha256=SiHWyWWEDy_Ak4ne0hgXPZCSP6mEuHH26wDhsed_9v8,519
170
167
  castor_extractor/visualization/metabase/client/db/__init__.py,sha256=nawDhJ-JGlpM6VMzZZRjf066QXk9kWzZr6l9n6OHTZ0,76
@@ -226,13 +223,13 @@ castor_extractor/visualization/qlik/extract.py,sha256=2ACqmWheVdkIXmDtmhdunf8oyN
226
223
  castor_extractor/visualization/salesforce_reporting/__init__.py,sha256=MvArD0GKNIpCDvLIYcpKrjMjFLhMyDETK6i3k0Fb6Tk,124
227
224
  castor_extractor/visualization/salesforce_reporting/assets.py,sha256=2J-iAmJGGDufOcJUgE47M3-dEcjYXcVyVUNcmHrj79w,271
228
225
  castor_extractor/visualization/salesforce_reporting/client/__init__.py,sha256=DIA6f_vNJZqT89qVYxg98Le7QeDn2y0Qew03V3J9t9o,44
229
- castor_extractor/visualization/salesforce_reporting/client/rest.py,sha256=hzaXWLcYt0aAHXK46DbsLmzocjRY1llwrNj8_3TObKs,1849
226
+ castor_extractor/visualization/salesforce_reporting/client/rest.py,sha256=97ud629qekagQvInQnTk-Ni0mFQKxJWyeYAeKO8XA6I,1866
230
227
  castor_extractor/visualization/salesforce_reporting/client/soql.py,sha256=DcJgchC9IYcK_bLdwskwycItCh3wtfKkwj4nyaSn66Q,1646
231
228
  castor_extractor/visualization/salesforce_reporting/extract.py,sha256=RMhlf7NeYiAO_8hkFk4-JxTghNbC0vtX3P2M80qt9U8,1339
232
229
  castor_extractor/visualization/sigma/__init__.py,sha256=GINql4yJLtjfOJgjHaWNpE13cMtnKNytiFRomwav27Q,114
233
230
  castor_extractor/visualization/sigma/assets.py,sha256=JZ1Cpxnml8P3mIJoTUM57hvylB18ErECQXaP5FF63O4,268
234
231
  castor_extractor/visualization/sigma/client/__init__.py,sha256=YQv06FBBQHvBMFg_tN0nUcmUp2NCL2s-eFTXG8rXaBg,74
235
- castor_extractor/visualization/sigma/client/client.py,sha256=RKFghxdlznAHvuBayg2SvgpqTN5pvtaeNEGbAnfbrR8,6189
232
+ castor_extractor/visualization/sigma/client/client.py,sha256=Gi8GzP_xxjDZDmNRK4pXJUvSPzZCCJpn6ClUTML5amE,6218
236
233
  castor_extractor/visualization/sigma/client/credentials.py,sha256=0f2VeDFaNbaZOTN0fPdmx3s-nxxFe35yBF9D_2B2lGI,718
237
234
  castor_extractor/visualization/sigma/client/endpoints.py,sha256=DBFphbgoH78_MZUGM_bKBAq28Nl7LWSZ6VRsbxrxtDg,1162
238
235
  castor_extractor/visualization/sigma/client/pagination.py,sha256=gHBewkYoJaR0vADzU_VPsNkcAa-6KAC6hplpDL5gT8U,690
@@ -273,9 +270,9 @@ castor_extractor/visualization/tableau/tsc_fields.py,sha256=BoV6XVu-HUan9hxeYRbv
273
270
  castor_extractor/visualization/tableau/types.py,sha256=_T3fahMHRkV2TVaYcjITh61T0FLzSBYKD21VurzkF5M,322
274
271
  castor_extractor/visualization/tableau/usage.py,sha256=LlFwlbEr-EnYUJjKZha99CRCRrERJ350oAvzBQlp9_s,427
275
272
  castor_extractor/visualization/tableau_revamp/__init__.py,sha256=a3DGjQhaz17gBqW-E84TAgupKbqLC40y5Ajo1yn-ot4,156
276
- castor_extractor/visualization/tableau_revamp/assets.py,sha256=HTJ6OyCkUdhv73VI2AlZFumat9kIz7T1dMJ4ljB_I6A,455
273
+ castor_extractor/visualization/tableau_revamp/assets.py,sha256=8sJsK6Qixao6xVmVaO1usvs16SjNub9sIx7o-adYV14,659
277
274
  castor_extractor/visualization/tableau_revamp/client/__init__.py,sha256=wmS9uLtUiqNYVloi0-DgD8d2qzu3RVZEAtWiaDp6G_M,90
278
- castor_extractor/visualization/tableau_revamp/client/client.py,sha256=_vlTckFRPsSQzIaLUM2RrXabHgFrWduV61Z8L8OSjA0,6902
275
+ castor_extractor/visualization/tableau_revamp/client/client.py,sha256=8pATeVTKslF5HCbN1c_DusysP7lTU51yXPp8uhzWwZg,7165
279
276
  castor_extractor/visualization/tableau_revamp/client/client_metadata_api.py,sha256=yNnGR3Tk32TUmaDejaz5fkw2p9DtmMeCv5rsZNOHUfY,3047
280
277
  castor_extractor/visualization/tableau_revamp/client/client_rest_api.py,sha256=0g8AddrhzirRCUWR2jrudPR02mk4Of5YilWth7zJO-g,4016
281
278
  castor_extractor/visualization/tableau_revamp/client/client_tsc.py,sha256=BBwIOqK2zU66udFRmLGmB_3J1ILGhVOY5Hq4nmsonF0,1853
@@ -311,18 +308,25 @@ castor_extractor/warehouse/bigquery/queries/view_ddl.sql,sha256=obCm-IN9V8_YSZTw
311
308
  castor_extractor/warehouse/bigquery/query.py,sha256=5Qc8PEa-kQKpTzguj4RNCAwKyvzWt20vAESYNB0lueo,4768
312
309
  castor_extractor/warehouse/bigquery/types.py,sha256=DHK3wUaaLyLMp7LP-7QkXTDYpYTZiPtvptAOkpxgp4g,88
313
310
  castor_extractor/warehouse/databricks/__init__.py,sha256=YG3YSIJgCFRjjI8eExy9T7qGnfnjWhMFh8c15KTs_BA,184
314
- castor_extractor/warehouse/databricks/client.py,sha256=lBIRMHucLWJzyk3TXKdT8W3adzr4W9r53W1gjzyA8hs,21434
315
- castor_extractor/warehouse/databricks/client_test.py,sha256=DpjkcvMbli-SYRNI-41VWG0xtQ4trjDoJBMxKs4CrPU,5625
311
+ castor_extractor/warehouse/databricks/api_client.py,sha256=lfS-DMLlTEsEMAEs7TeH8JmLX74l4Ai0k12nuP2fo2Y,8110
312
+ castor_extractor/warehouse/databricks/api_client_test.py,sha256=YTWC-X7L-XAfK5b39TUgTmR1ifv0QrY5tvLNoSbpmjg,466
313
+ castor_extractor/warehouse/databricks/client.py,sha256=neH-KnyWtxEMApbjIV2uhY7Me3tCpavd1NMnljrT05k,4768
314
+ castor_extractor/warehouse/databricks/client_test.py,sha256=UKr_D3M8mhqV1oL2_3y_6pEzAFLVE3FHDNZh4omFLK4,2286
316
315
  castor_extractor/warehouse/databricks/credentials.py,sha256=iphbVynVTQXMEbJy4QaT5fer-GpOi7QtbAlg8R7-Lj4,598
316
+ castor_extractor/warehouse/databricks/endpoints.py,sha256=qPoL9CtPFJdwVuW9rJ37nmeMd-nChOBouEVYb4SlaUE,670
317
317
  castor_extractor/warehouse/databricks/extract.py,sha256=VYygE06f7ngYWVlRa48O6drLIZF-_4IBJdyXTYfxZQU,7395
318
318
  castor_extractor/warehouse/databricks/format.py,sha256=p252NFzQN1uZdsu5wpP-bMHK0rBBVzallX3-o92Mvh4,6744
319
319
  castor_extractor/warehouse/databricks/format_test.py,sha256=ls0IcOElqp_qecAzNbK0zdca7Pms4seCHimbw8NAoAI,3322
320
+ castor_extractor/warehouse/databricks/lineage.py,sha256=qWVXCT9bRYVYPV5hsiUgPcdThsMN-6EeCEDKL8Fykj0,4724
321
+ castor_extractor/warehouse/databricks/lineage_test.py,sha256=EejO4qKH_kJlJSrIap6GvkUi9E55RFvfiySKazAh0_A,1048
322
+ castor_extractor/warehouse/databricks/pagination.py,sha256=pYxdoUBEGkd1p_zQRme60NEn3dBp7H0VxQO3la-gOmc,551
323
+ castor_extractor/warehouse/databricks/sql_client.py,sha256=KBP0rmMQBWw3jshDfv_NpFW8HqPxGfcBkS4d9T9aXvE,2977
320
324
  castor_extractor/warehouse/databricks/test_constants.py,sha256=Hm96yq_ltVAKv7WYhYz637r4Cuj-1cCdyOuxMEe3J-Q,2246
321
325
  castor_extractor/warehouse/databricks/types.py,sha256=hD6gC8oiT3QSWEvbtgUOGK_lLzzz36sEauB3lS_wxlE,218
322
- castor_extractor/warehouse/databricks/utils.py,sha256=RWRViqLaj2K0in5T5F6OLp7HCm554BCh3zi4CJqOEt8,576
323
- castor_extractor/warehouse/databricks/utils_test.py,sha256=5Qrd_tLNLWrDHX2uQyVUf0vqXJzD44uQGGxDBOkwvUU,503
326
+ castor_extractor/warehouse/databricks/utils.py,sha256=QOYpv50rqxUrr302vdzXJlBRT4CZV8zb7gtmW9g5n2E,1954
327
+ castor_extractor/warehouse/databricks/utils_test.py,sha256=_guTuzRWRTZdDY7ils0X1K8jhI9T877MEtw3x_YDg9I,2415
324
328
  castor_extractor/warehouse/mysql/__init__.py,sha256=2KFDogo9GNbApHqw3Vm5t_uNmIRjdp76nmP_WQQMfQY,116
325
- castor_extractor/warehouse/mysql/client.py,sha256=TgC7HfEReKOCO0ynJ3YqoJqmbRj9zaLnMjaRynOg7ao,1060
329
+ castor_extractor/warehouse/mysql/client.py,sha256=DUDI8Zm24kxYjh9xYgaRZUj8K_JlPjcjr67gmGfFpNs,942
326
330
  castor_extractor/warehouse/mysql/client_test.py,sha256=wRTv-3c5chy_HKj-buasNiYOOCIfynYqbabM4Hxdh5E,1052
327
331
  castor_extractor/warehouse/mysql/extract.py,sha256=nGDVA1DrMBQEuUBFrNwnzZbUR0SZeg0a8QN2Aemfnto,2124
328
332
  castor_extractor/warehouse/mysql/queries/.sqlfluff,sha256=RjzW9cyXVYL1l55HpaC3zFren7CIh9lVGwoODNk2i-4,27
@@ -360,11 +364,12 @@ castor_extractor/warehouse/redshift/queries/user.sql,sha256=sEXveJAuNvZacvpI6Wfw
360
364
  castor_extractor/warehouse/redshift/queries/view_ddl.sql,sha256=Pkyh_QT6d4rhTeyiVcqw6O8CRl7NEhk2p7eM5YIn5kg,719
361
365
  castor_extractor/warehouse/redshift/query.py,sha256=0C81rkt2cpkWrJIxxwALDyqr-49vlqQM04y_N6wwStc,540
362
366
  castor_extractor/warehouse/salesforce/__init__.py,sha256=NR4aNea5jeE1xYqeZ_29deeN84CkN0_D_Z7CLQdJvFY,137
363
- castor_extractor/warehouse/salesforce/client.py,sha256=F3UdD5-9umEU-u_c7uVtaksg81VZeXRW83BVsFvYDkE,4902
367
+ castor_extractor/warehouse/salesforce/client.py,sha256=NbbXTi_eX0ge815FgsiWh4uUnvZMOAl9_mXA_e172_0,3281
364
368
  castor_extractor/warehouse/salesforce/constants.py,sha256=GusduVBCPvwpk_Im6F3bDvXeNQ7hRnCMdIAjIg65RnE,52
365
369
  castor_extractor/warehouse/salesforce/extract.py,sha256=GaxkGWhdksDT_rlT24KX8DMpWnhKlhDMAUvBPGalli0,3454
366
370
  castor_extractor/warehouse/salesforce/format.py,sha256=eiPM_4i_m3FEg_2jkMYlhaRBg3gTvV-9xQuk8ghJZiM,3289
367
371
  castor_extractor/warehouse/salesforce/format_test.py,sha256=6xDtCxNqvLo5JeHCtXyAun62WMzfVaVsvvMGXXfGgmA,2254
372
+ castor_extractor/warehouse/salesforce/pagination.py,sha256=m1S9JRNf6Oe-6dDghYUY5wwTzGzKW5H9pE60PCXMha0,920
368
373
  castor_extractor/warehouse/salesforce/soql.py,sha256=XB8ohKwHFfC4Xger7Y84DXLW17IJDye_bZ3FL6DCcOI,1188
369
374
  castor_extractor/warehouse/snowflake/__init__.py,sha256=TEGXTyxWp4Tr9gIHb-UFVTRKj6YWmrRtqHruiKSZGiY,174
370
375
  castor_extractor/warehouse/snowflake/client.py,sha256=XT0QLVNff_586SDuMe40iu8FCwPDh2uBV5aKc1Ql914,5555
@@ -387,7 +392,7 @@ castor_extractor/warehouse/snowflake/queries/user.sql,sha256=88V8eRj1NDaD_ufclsK
387
392
  castor_extractor/warehouse/snowflake/queries/view_ddl.sql,sha256=eWsci_50cxiYIv3N7BKkbXVM3RoIzqSDtohqRnE5kg4,673
388
393
  castor_extractor/warehouse/snowflake/query.py,sha256=yDpG4e23xtjEfAKNSAgL9wx17ChFSlvAbig2mJ5ZEC0,1769
389
394
  castor_extractor/warehouse/sqlserver/__init__.py,sha256=PdOuYznmvKAbfWAm8UdN47MfEsd9jqPi_dDi3WEo1KY,116
390
- castor_extractor/warehouse/sqlserver/client.py,sha256=MpjfIlUvWYNuHJmnFsd7rBYdGllAJPuk7CZKuSE_E5w,1709
395
+ castor_extractor/warehouse/sqlserver/client.py,sha256=l6O0OhAKtRqy0oTl9KDYDawgWKc4XCNOA-bVdnMdEjM,1592
391
396
  castor_extractor/warehouse/sqlserver/extract.py,sha256=2mBNx9clyrhoiirD635BW-5u6pPoxHyIsB071XoZjho,2087
392
397
  castor_extractor/warehouse/sqlserver/queries/.sqlfluff,sha256=yy0KQdz8I_67vnXyX8eeWwOWkxTXvHyVKSVwhURktd8,48
393
398
  castor_extractor/warehouse/sqlserver/queries/column.sql,sha256=Szdf8hwcDffRTgtD6zf4ZuIyHIVijFgSDk1rZbKI3g8,2480
@@ -406,8 +411,8 @@ castor_extractor/warehouse/synapse/queries/schema.sql,sha256=aX9xNrBD_ydwl-znGSF
406
411
  castor_extractor/warehouse/synapse/queries/table.sql,sha256=mCE8bR1Vb7j7SwZW2gafcXidQ2fo1HwxcybA8wP2Kfs,1049
407
412
  castor_extractor/warehouse/synapse/queries/user.sql,sha256=sTb_SS7Zj3AXW1SggKPLNMCd0qoTpL7XI_BJRMaEpBg,67
408
413
  castor_extractor/warehouse/synapse/queries/view_ddl.sql,sha256=3EVbp5_yTgdByHFIPLHmnoOnqqLE77SrjAwFDvu4e54,249
409
- castor_extractor-0.19.4.dist-info/LICENCE,sha256=sL-IGa4hweyya1HgzMskrRdybbIa2cktzxb5qmUgDg8,8254
410
- castor_extractor-0.19.4.dist-info/METADATA,sha256=1jzZUZIN0akVRTWJNZ0HLBCKikI-3cPHAO3kabMNBhw,20275
411
- castor_extractor-0.19.4.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
412
- castor_extractor-0.19.4.dist-info/entry_points.txt,sha256=X_pDYOmhUUMbiAD9h2GZveuGdT8UgL38KJqP44xkvqo,1495
413
- castor_extractor-0.19.4.dist-info/RECORD,,
414
+ castor_extractor-0.19.7.dist-info/LICENCE,sha256=sL-IGa4hweyya1HgzMskrRdybbIa2cktzxb5qmUgDg8,8254
415
+ castor_extractor-0.19.7.dist-info/METADATA,sha256=C94_SY5XYZLhVttCVc8CHNOIKny9F9mTiDpq_dBt79A,20511
416
+ castor_extractor-0.19.7.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
417
+ castor_extractor-0.19.7.dist-info/entry_points.txt,sha256=X_pDYOmhUUMbiAD9h2GZveuGdT8UgL38KJqP44xkvqo,1495
418
+ castor_extractor-0.19.7.dist-info/RECORD,,
@@ -1,89 +0,0 @@
1
- import logging
2
- from typing import Any, Callable, Dict, Literal, Optional
3
-
4
- import requests
5
-
6
- from .api.safe_request import (
7
- RequestSafeMode,
8
- handle_response,
9
- )
10
-
11
- logger = logging.getLogger(__name__)
12
-
13
- DEFAULT_TIMEOUT_S = 30
14
-
15
- # https://requests.readthedocs.io/en/latest/api/#requests.request
16
- HttpMethod = Literal["GET", "OPTIONS", "HEAD", "POST", "PUT", "PATCH", "DELETE"]
17
-
18
-
19
- def _authentication_header(token: Optional[str] = None) -> Dict[str, str]:
20
- if token:
21
- return {"Authorization": f"Bearer {token}"}
22
- return dict()
23
-
24
-
25
- class APIClientDeprecated:
26
- """
27
- API client
28
- - authentication via access token
29
- """
30
-
31
- def __init__(
32
- self,
33
- host: str,
34
- token: Optional[str] = None,
35
- headers: Optional[Dict[str, str]] = None,
36
- timeout: int = DEFAULT_TIMEOUT_S,
37
- safe_mode: RequestSafeMode = RequestSafeMode(),
38
- ):
39
- self._host = host
40
- self._token = token or ""
41
- self._timeout = timeout
42
- self._base_headers = headers or {}
43
- self.safe_mode = safe_mode
44
-
45
- @staticmethod
46
- def build_url(host: str, path: str):
47
- if not host.startswith("https://"):
48
- host = "https://" + host
49
- return f"{host.strip('/')}/{path}"
50
-
51
- @property
52
- def _headers(self):
53
- """Returns specified headers and authentication headers altogether"""
54
- return {**self._base_headers, **_authentication_header(self._token)}
55
-
56
- def _call(
57
- self,
58
- url: str,
59
- method: HttpMethod = "GET",
60
- *,
61
- params: Optional[dict] = None,
62
- data: Optional[dict] = None,
63
- processor: Optional[Callable] = None,
64
- ) -> Any:
65
- logger.debug(f"Calling {method} on {url}")
66
- response = requests.request(
67
- method,
68
- url,
69
- headers=self._headers,
70
- params=params,
71
- json=data,
72
- timeout=self._timeout,
73
- )
74
- response_payload = handle_response(response, self.safe_mode)
75
-
76
- if processor:
77
- return processor(response)
78
-
79
- return response_payload
80
-
81
- def get(
82
- self,
83
- path: str,
84
- payload: Optional[dict] = None,
85
- processor: Optional[Callable] = None,
86
- ) -> dict:
87
- """path: REST API operation path, such as /api/2.0/clusters/get"""
88
- url = self.build_url(self._host, path)
89
- return self._call(url=url, data=payload, processor=processor)
@@ -1,18 +0,0 @@
1
- from .api_deprecated import APIClientDeprecated
2
-
3
-
4
- def test_APIClient_build_url():
5
- expected = "https://3.14.azuredatabricks.net/api/2.1/unity-catalog/tables"
6
-
7
- path = "api/2.1/unity-catalog/tables"
8
-
9
- host = "3.14.azuredatabricks.net"
10
- assert expected == APIClientDeprecated.build_url(host, path)
11
-
12
- host_with_http = "https://3.14.azuredatabricks.net"
13
- assert expected == APIClientDeprecated.build_url(host_with_http, path)
14
-
15
- host_with_trailing_slash = "https://3.14.azuredatabricks.net/"
16
- assert expected == APIClientDeprecated.build_url(
17
- host_with_trailing_slash, path
18
- )
@@ -1,52 +0,0 @@
1
- from typing import Any, Callable, Dict, Iterator, Optional, Sequence, TypeVar
2
-
3
- from .pager import (
4
- DEFAULT_PER_PAGE,
5
- AbstractPager,
6
- PagerLogger,
7
- PagerStopStrategy,
8
- )
9
-
10
- T = TypeVar("T")
11
-
12
-
13
- class PagerOnToken(AbstractPager):
14
- """Token-based pagination"""
15
-
16
- def __init__(
17
- self,
18
- callback: Callable[[Optional[str], Optional[int]], Dict[Any, Any]],
19
- *,
20
- logger: Optional[PagerLogger] = None,
21
- start_page: int = 1,
22
- stop_strategy: PagerStopStrategy = PagerStopStrategy.EMPTY_PAGE,
23
- ):
24
- self._callback = callback
25
- self._logger = logger or PagerLogger()
26
- self._start_page = start_page
27
- self._stop_strategy = stop_strategy
28
-
29
- def iterator(
30
- self,
31
- per_page: int = DEFAULT_PER_PAGE,
32
- ) -> Iterator[Sequence[T]]:
33
- """Yields data provided by the callback as a list using the nexttoken"""
34
- stop_on_empty_page = self._stop_strategy == PagerStopStrategy.EMPTY_PAGE
35
- page = self._start_page
36
- total_results = 0
37
- page_token = None
38
- while True:
39
- results = self._callback(page_token, per_page)
40
- nb_results = len(results.get("res", []))
41
- total_results += nb_results
42
-
43
- if results.get("res"):
44
- yield results["res"]
45
-
46
- stop = self.should_stop(nb_results, per_page, stop_on_empty_page)
47
- page_token = results.get("next_page_token")
48
- if stop or not page_token:
49
- break
50
- page += 1
51
-
52
- self._logger.on_success(page, total_results)
@@ -1,73 +0,0 @@
1
- from typing import Any, Callable, Dict, List, Optional
2
-
3
- from .pager_on_token import PagerOnToken
4
-
5
- ITEMS = list(range(1000))
6
-
7
- OStr = Optional[str]
8
-
9
-
10
- def _make_callback_with_token(
11
- elements: List[Dict[str, str]],
12
- ) -> Callable[[OStr, int], Dict[str, Any]]:
13
- def _callback(page_token: OStr, per_page: int) -> Dict[str, Any]:
14
- """callable with a token that indicates how to retrieve the next page"""
15
- if page_token:
16
- _start = int(page_token)
17
- else:
18
- _start = 0
19
- _end = _start + per_page
20
- return {"res": elements[_start:_end], "next_page_token": str(_end)}
21
-
22
- return _callback
23
-
24
-
25
- def _make_callback_with_missing_token(
26
- elements: List[Dict[str, str]],
27
- ) -> Callable[[OStr, int], Dict[str, Any]]:
28
- def _callback(page_token: OStr, per_page: int) -> Dict[str, Any]:
29
- """callable with a token that indicates how to retrieve the next page
30
- except for the last page"""
31
- if page_token:
32
- _start = int(page_token)
33
- else:
34
- _start = 0
35
- _end = _start + per_page
36
- if _end == len(ITEMS):
37
- return {"res": elements[_start:_end]}
38
- return {"res": elements[_start:_end], "next_page_token": str(_end)}
39
-
40
- return _callback
41
-
42
-
43
- def test_pagerontoken__all():
44
- """unit test for PagerOnToken#all()"""
45
- pager = PagerOnToken(_make_callback_with_token(ITEMS))
46
- # When no argument provided
47
- assert pager.all() == ITEMS
48
- # When per page is less than the number of ITEMS
49
- assert pager.all(per_page=1) == ITEMS
50
- # When per page is more than the number of ITEMS
51
- assert pager.all(per_page=len(ITEMS) + 20) == ITEMS
52
-
53
- # Same test suite, but no token is provided at the last call
54
- pager = PagerOnToken(_make_callback_with_missing_token(ITEMS))
55
- # When no argument provided
56
- assert pager.all() == ITEMS
57
- # When per page is less than the number of ITEMS
58
- assert pager.all(per_page=1) == ITEMS
59
- # When per page is more than the number of ITEMS
60
- assert pager.all(per_page=len(ITEMS) + 20) == ITEMS
61
-
62
-
63
- def test_pagerontoken__iterator__pagination():
64
- """unit test for PagerOnToken#iterator() (pagination)"""
65
- pager = PagerOnToken(_make_callback_with_token(ITEMS))
66
-
67
- def nb_of_pages(per_page: int) -> int:
68
- return len([page for page in pager.iterator(per_page=per_page)])
69
-
70
- assert nb_of_pages(per_page=len(ITEMS)) == 1
71
- assert nb_of_pages(per_page=1) == len(ITEMS)
72
- assert nb_of_pages(per_page=2) == len(ITEMS) // 2
73
- assert nb_of_pages(per_page=4) == len(ITEMS) // 4