castor-extractor 0.23.2__py3-none-any.whl → 0.23.3__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,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.23.3 - 2025-02-19
4
+
5
+ * Snowflake : add --insecure-mode option to turn off OCSP checking
6
+
3
7
  ## 0.23.2 - 2025-02-17
4
8
 
5
9
  * support page_size in Tableau extraction command
README.md CHANGED
@@ -34,14 +34,14 @@ It also embeds utilities to help you push your metadata to Castor:
34
34
 
35
35
  ## Installation
36
36
 
37
- Requirements: **python3.8+**
37
+ Requirements: **python3.9+**
38
38
  <img src="https://upload.wikimedia.org/wikipedia/commons/c/c3/Python-logo-notext.svg" width=20 />
39
39
 
40
40
  ### Create castor-env
41
41
 
42
42
  We advise to create a dedicated [Python environment](https://docs.python.org/3/library/venv.html).
43
43
 
44
- Here's an example using `Pyenv` and Python `3.8.12`:
44
+ Here's an example using `Pyenv`:
45
45
 
46
46
  - Install Pyenv
47
47
 
@@ -58,22 +58,24 @@ eval "$(pyenv init --path)"
58
58
  eval "$(pyenv virtualenv-init -)"
59
59
  ```
60
60
 
61
- - [optional] Install python 3.8+
61
+ - [optional] Install python 3.9+ if needed
62
62
 
63
63
  ```bash
64
64
  pyenv versions # check your local python installations
65
65
 
66
- pyenv install -v 3.8.12 # if none of the installed versions satisfy requirements 8+
66
+ # install Python if none of the installed versions satisfy requirements 3.9+
67
+ # in this example, we will install Python 3.11.9
68
+ pyenv install -v 3.11.9
67
69
  ```
68
70
 
69
71
  - Create your virtual env
70
72
 
71
73
  ```bash
72
- pyenv virtualenv 3.8.12 castor-env # create a dedicated env
74
+ pyenv virtualenv 3.11.9 castor-env # create a dedicated env
73
75
  pyenv shell castor-env # activate the environment
74
76
 
75
77
  # optional checks
76
- python --version # should be `3.8.12`
78
+ python --version # should be `3.11.9`
77
79
  pyenv version # should be `castor-env`
78
80
  ```
79
81
 
@@ -40,6 +40,11 @@ def main():
40
40
  action="store_true",
41
41
  help="Optional: will fetch transients tables if added",
42
42
  )
43
+ parser.add_argument(
44
+ "--insecure-mode",
45
+ action="store_true",
46
+ help="Optional: turns off OCSP checking",
47
+ )
43
48
 
44
49
  parser.add_argument("-o", "--output", help="Directory to write to")
45
50
 
@@ -65,4 +70,5 @@ def main():
65
70
  output_directory=args.output,
66
71
  skip_existing=args.skip_existing,
67
72
  fetch_transient=args.fetch_transient,
73
+ insecure_mode=args.insecure_mode,
68
74
  )
@@ -112,6 +112,7 @@ class SnowflakeClient(SqlalchemyClient):
112
112
  role: Optional[str] = None,
113
113
  ):
114
114
  self.private_key = _private_key(credentials.get("private_key"))
115
+ self.insecure_mode = credentials.get("insecure_mode", False)
115
116
  super().__init__(credentials)
116
117
  self._role = role
117
118
  self._warehouse = warehouse
@@ -121,13 +122,22 @@ class SnowflakeClient(SqlalchemyClient):
121
122
  return "Snowflake"
122
123
 
123
124
  def _engine_options(self, credentials: dict) -> dict:
124
- if not self.private_key:
125
- return {}
126
- return {
127
- "connect_args": {
128
- "private_key": self.private_key,
129
- }
130
- }
125
+ """
126
+ Sets the engine options.
127
+ * `insecure_mode` = True turns off OCSP checking.
128
+ See https://community.snowflake.com/s/article/How-to-turn-off-OCSP-checking-in-Snowflake-client-drivers
129
+ * `private_key` = Snowflake private key for key pair authentication.
130
+ See https://docs.snowflake.com/en/user-guide/key-pair-auth
131
+ """
132
+ connection_args: dict = dict()
133
+
134
+ if self.insecure_mode:
135
+ connection_args["insecure_mode"] = True
136
+
137
+ if self.private_key:
138
+ connection_args["private_key"] = self.private_key
139
+
140
+ return {"connect_args": connection_args}
131
141
 
132
142
  def _build_uri(self, credentials: dict) -> str:
133
143
  if self.private_key:
@@ -17,6 +17,7 @@ class SnowflakeCredentials:
17
17
  account: str
18
18
  user: str
19
19
 
20
+ insecure_mode: Optional[bool] = field(default=False)
20
21
  password: Optional[str] = field(metadata={"sensitive": True}, default=None)
21
22
  private_key: Optional[str] = field(
22
23
  metadata={"sensitive": True}, default=None
@@ -38,6 +38,7 @@ SNOWFLAKE_ACCOUNT = "CASTOR_SNOWFLAKE_ACCOUNT"
38
38
  SNOWFLAKE_USER = "CASTOR_SNOWFLAKE_USER"
39
39
  SNOWFLAKE_PASSWORD = "CASTOR_SNOWFLAKE_PASSWORD" # noqa: S105
40
40
  SNOWFLAKE_PRIVATE_KEY = "CASTOR_SNOWFLAKE_PRIVATE_KEY"
41
+ SNOWFLAKE_INSECURE_MODE = "CASTOR_SNOWFLAKE_INSECURE_MODE"
41
42
 
42
43
 
43
44
  def _credentials(params: dict) -> dict:
@@ -46,9 +47,15 @@ def _credentials(params: dict) -> dict:
46
47
  private_key = params.get("private_key") or from_env(
47
48
  SNOWFLAKE_PRIVATE_KEY, True
48
49
  )
50
+ insecure_mode = (
51
+ params.get("insecure_mode")
52
+ or from_env(SNOWFLAKE_INSECURE_MODE, allow_missing=True)
53
+ or False
54
+ )
49
55
  common = {
50
56
  "account": params.get("account") or from_env(SNOWFLAKE_ACCOUNT),
51
57
  "user": params.get("user") or from_env(SNOWFLAKE_USER),
58
+ "insecure_mode": insecure_mode,
52
59
  }
53
60
  if password:
54
61
  return {**common, "password": password}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: castor-extractor
3
- Version: 0.23.2
3
+ Version: 0.23.3
4
4
  Summary: Extract your metadata assets.
5
5
  Home-page: https://www.castordoc.com/
6
6
  License: EULA
@@ -100,14 +100,14 @@ It also embeds utilities to help you push your metadata to Castor:
100
100
 
101
101
  ## Installation
102
102
 
103
- Requirements: **python3.8+**
103
+ Requirements: **python3.9+**
104
104
  <img src="https://upload.wikimedia.org/wikipedia/commons/c/c3/Python-logo-notext.svg" width=20 />
105
105
 
106
106
  ### Create castor-env
107
107
 
108
108
  We advise to create a dedicated [Python environment](https://docs.python.org/3/library/venv.html).
109
109
 
110
- Here's an example using `Pyenv` and Python `3.8.12`:
110
+ Here's an example using `Pyenv`:
111
111
 
112
112
  - Install Pyenv
113
113
 
@@ -124,22 +124,24 @@ eval "$(pyenv init --path)"
124
124
  eval "$(pyenv virtualenv-init -)"
125
125
  ```
126
126
 
127
- - [optional] Install python 3.8+
127
+ - [optional] Install python 3.9+ if needed
128
128
 
129
129
  ```bash
130
130
  pyenv versions # check your local python installations
131
131
 
132
- pyenv install -v 3.8.12 # if none of the installed versions satisfy requirements 8+
132
+ # install Python if none of the installed versions satisfy requirements 3.9+
133
+ # in this example, we will install Python 3.11.9
134
+ pyenv install -v 3.11.9
133
135
  ```
134
136
 
135
137
  - Create your virtual env
136
138
 
137
139
  ```bash
138
- pyenv virtualenv 3.8.12 castor-env # create a dedicated env
140
+ pyenv virtualenv 3.11.9 castor-env # create a dedicated env
139
141
  pyenv shell castor-env # activate the environment
140
142
 
141
143
  # optional checks
142
- python --version # should be `3.8.12`
144
+ python --version # should be `3.11.9`
143
145
  pyenv version # should be `castor-env`
144
146
  ```
145
147
 
@@ -206,6 +208,10 @@ For any questions or bug report, contact us at [support@castordoc.com](mailto:su
206
208
 
207
209
  # Changelog
208
210
 
211
+ ## 0.23.3 - 2025-02-19
212
+
213
+ * Snowflake : add --insecure-mode option to turn off OCSP checking
214
+
209
215
  ## 0.23.2 - 2025-02-17
210
216
 
211
217
  * support page_size in Tableau extraction command
@@ -1,8 +1,8 @@
1
- CHANGELOG.md,sha256=s6P_wRcecQhMAvMkLLh7ZI79FCVyK3hs4Hoc_lE_Ers,15605
1
+ CHANGELOG.md,sha256=Y2Enjbq1QIfk8Ezom_8lECm-6gpEmRJpP7tNcLxHzpc,15697
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
- README.md,sha256=uF6PXm9ocPITlKVSh9afTakHmpLx3TvawLf-CbMP3wM,3578
5
+ README.md,sha256=j8oiToTvFY4eozLUJo4rs0LEqan-G3_eOSP98KFfxfM,3634
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
@@ -22,7 +22,7 @@ castor_extractor/commands/extract_redshift.py,sha256=zRBg2D_ft4GLdPSdmetRcgQVAA8
22
22
  castor_extractor/commands/extract_salesforce.py,sha256=3j3YTmMkPAwocR-B1ozJQai0UIZPtpmAyWj-hHvdWn4,1226
23
23
  castor_extractor/commands/extract_salesforce_reporting.py,sha256=FdANTNiLkIPdm80XMYxWReHjdycLsIa61pyeCD-sUDk,962
24
24
  castor_extractor/commands/extract_sigma.py,sha256=sxewHcZ1Doq35V2qnpX_zCKKXkrb1_9bYjUMg7BOW-k,643
25
- castor_extractor/commands/extract_snowflake.py,sha256=vYiruxRoo--GeMemOGsSE1w9kcKTh_y4E165HtMVzkM,1982
25
+ castor_extractor/commands/extract_snowflake.py,sha256=GwlrRxwEBjHqGs_3bs5vM9fzmv61_iwvBr1KcIgFgWM,2161
26
26
  castor_extractor/commands/extract_sqlserver.py,sha256=lwhbcNChaXHZgMgSOch3faVr7WJw-sDU6GHl3lzBt_0,1141
27
27
  castor_extractor/commands/extract_tableau.py,sha256=DGQaXS-61rV-uzBtqfvqtyQzjLtrLTzE1ViTXPG1eck,1379
28
28
  castor_extractor/commands/extract_thoughtspot.py,sha256=caAYJlH-vK7u5IUB6OKXxcaWfLgc7d_XqnFDWK6YNS4,639
@@ -406,11 +406,11 @@ castor_extractor/warehouse/salesforce/format_test.py,sha256=puTL-Co84jE2SQzKFKGL
406
406
  castor_extractor/warehouse/salesforce/pagination.py,sha256=m1S9JRNf6Oe-6dDghYUY5wwTzGzKW5H9pE60PCXMha0,920
407
407
  castor_extractor/warehouse/salesforce/soql.py,sha256=XB8ohKwHFfC4Xger7Y84DXLW17IJDye_bZ3FL6DCcOI,1188
408
408
  castor_extractor/warehouse/snowflake/__init__.py,sha256=TEGXTyxWp4Tr9gIHb-UFVTRKj6YWmrRtqHruiKSZGiY,174
409
- castor_extractor/warehouse/snowflake/client.py,sha256=XT0QLVNff_586SDuMe40iu8FCwPDh2uBV5aKc1Ql914,5555
409
+ castor_extractor/warehouse/snowflake/client.py,sha256=RB72bbl_k91wDU76yrggPK6oeEm96Uopc8gYSUUB9ZM,6093
410
410
  castor_extractor/warehouse/snowflake/client_test.py,sha256=ihWtOOAQfh8pu5JTr_EWfqefKOVIaJXznACURzaU1Qs,1432
411
- castor_extractor/warehouse/snowflake/credentials.py,sha256=wbUdbx9jVSHzg2kNDhMFuDstbVTyZOcGAwnSeGeFIqs,875
411
+ castor_extractor/warehouse/snowflake/credentials.py,sha256=u0sZ6xPtcZmmvnUsAejJk-YxGl8BTzX_BlRjRk92BYU,932
412
412
  castor_extractor/warehouse/snowflake/credentials_test.py,sha256=Lkc-DHXOvr50KrqAW4nt_x0IA0Mu_CsBVu6ATnzQB6I,673
413
- castor_extractor/warehouse/snowflake/extract.py,sha256=fcze0VBe9OOAFSr25T9L6CY506Vm_xDEvvy8NWuLW1s,2956
413
+ castor_extractor/warehouse/snowflake/extract.py,sha256=3yc9kcVtt2c1uWJOJJgeZchV4VmRr9EeYM3W6gl8zQQ,3201
414
414
  castor_extractor/warehouse/snowflake/queries/.sqlfluff,sha256=vttrwcr64JVIuvc7WIg9C54cbOkjg_VjXNR7YnTGOPE,31
415
415
  castor_extractor/warehouse/snowflake/queries/column.sql,sha256=Wy-arvS_3Dh0HFrzdpRmBsI58mMlN_5U097s5kMNluQ,1781
416
416
  castor_extractor/warehouse/snowflake/queries/column_lineage.sql,sha256=YKBiZ6zySSNcXLDXwm31EjGIIkkkZc0-S6hI1SRM80o,1179
@@ -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.23.2.dist-info/LICENCE,sha256=sL-IGa4hweyya1HgzMskrRdybbIa2cktzxb5qmUgDg8,8254
440
- castor_extractor-0.23.2.dist-info/METADATA,sha256=XaEyHkKuPo14vRz6eAIjuvl3lzn6496vYtkefRZMuOA,22621
441
- castor_extractor-0.23.2.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
442
- castor_extractor-0.23.2.dist-info/entry_points.txt,sha256=7aVSxc-_2dicp28Ow-S4y0p4wGoTm9zGmVptMvfLdw8,1649
443
- castor_extractor-0.23.2.dist-info/RECORD,,
439
+ castor_extractor-0.23.3.dist-info/LICENCE,sha256=sL-IGa4hweyya1HgzMskrRdybbIa2cktzxb5qmUgDg8,8254
440
+ castor_extractor-0.23.3.dist-info/METADATA,sha256=45hN2SrAxHN-Ldg2hJy-jowQKdq3PEAbFUcm6ctYeXc,22769
441
+ castor_extractor-0.23.3.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
442
+ castor_extractor-0.23.3.dist-info/entry_points.txt,sha256=7aVSxc-_2dicp28Ow-S4y0p4wGoTm9zGmVptMvfLdw8,1649
443
+ castor_extractor-0.23.3.dist-info/RECORD,,