quollio-core 0.7.0__py3-none-any.whl → 0.8.0__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.
- quollio_core/__init__.py +1 -1
- quollio_core/bigquery.py +25 -2
- quollio_core/bricks.py +26 -4
- quollio_core/redshift.py +3 -1
- quollio_core/snowflake.py +3 -1
- quollio_core/teradata.py +25 -2
- {quollio_core-0.7.0.dist-info → quollio_core-0.8.0.dist-info}/METADATA +3 -4
- {quollio_core-0.7.0.dist-info → quollio_core-0.8.0.dist-info}/RECORD +10 -10
- {quollio_core-0.7.0.dist-info → quollio_core-0.8.0.dist-info}/WHEEL +0 -0
- {quollio_core-0.7.0.dist-info → quollio_core-0.8.0.dist-info}/licenses/LICENSE +0 -0
quollio_core/__init__.py
CHANGED
quollio_core/bigquery.py
CHANGED
@@ -3,11 +3,12 @@ import json
|
|
3
3
|
|
4
4
|
from google.auth.credentials import Credentials
|
5
5
|
|
6
|
+
from quollio_core.helper.core import is_valid_domain
|
6
7
|
from quollio_core.helper.env_default import env_default
|
7
8
|
from quollio_core.helper.log_utils import configure_logging, error_handling_decorator, logger
|
8
9
|
from quollio_core.profilers.bigquery import bigquery_table_lineage, bigquery_table_stats
|
9
10
|
from quollio_core.profilers.qdc import gen_existing_global_id_dict, get_avro_file_content
|
10
|
-
from quollio_core.repository import qdc
|
11
|
+
from quollio_core.repository import qdc, ssm
|
11
12
|
from quollio_core.repository.bigquery import BigQueryClient, get_credentials, get_org_id
|
12
13
|
|
13
14
|
|
@@ -166,6 +167,16 @@ if __name__ == "__main__":
|
|
166
167
|
help="Whether to enable multi-projects support. If set to 'true', \
|
167
168
|
the script will load lineage and stats from all projects accessible by the credentials. Default is 'false'.",
|
168
169
|
)
|
170
|
+
parser.add_argument(
|
171
|
+
"--external_api_access",
|
172
|
+
type=str,
|
173
|
+
choices=["PUBLIC", "VPC_ENDPOINT"],
|
174
|
+
action=env_default("EXTERNAL_API_ACCESS"),
|
175
|
+
default="PUBLIC",
|
176
|
+
required=False,
|
177
|
+
help="Access method to Quollio API. Default 'PUBLIC'. Choose 'VPC_ENDPOINT'\
|
178
|
+
if you use API Gateway VPC Endpoint, DefaultValue is set to PUBLIC.",
|
179
|
+
)
|
169
180
|
|
170
181
|
args = parser.parse_args()
|
171
182
|
|
@@ -175,9 +186,21 @@ if __name__ == "__main__":
|
|
175
186
|
|
176
187
|
configure_logging(args.log_level)
|
177
188
|
|
189
|
+
api_url = args.api_url
|
190
|
+
if args.external_api_access == "VPC_ENDPOINT":
|
191
|
+
logger.debug("Using VPC Endpoint for Quollio API access")
|
192
|
+
api_url, err = ssm.get_parameter_by_assume_role(args.api_url)
|
193
|
+
if err is not None:
|
194
|
+
logger.error("Fail to ssm.get_parameter_by_assume_role. {err}".format(err=err))
|
195
|
+
raise Exception("Fail to ssm.get_parameter_by_assume_role. {err}".format(err=err))
|
196
|
+
is_domain_valid = is_valid_domain(domain=api_url, domain_type=args.external_api_access)
|
197
|
+
if not is_domain_valid:
|
198
|
+
raise ValueError("The format of quollio API URL is invalid. The URL must end with `.com` or /api.")
|
199
|
+
logger.debug("API URL: %s", api_url)
|
200
|
+
|
178
201
|
credentials = initialize_credentials(args.credentials_json)
|
179
202
|
org_id = initialize_org_id(args.credentials_json)
|
180
|
-
qdc_client = qdc.initialize_qdc_client(
|
203
|
+
qdc_client = qdc.initialize_qdc_client(api_url, args.client_id, args.client_secret)
|
181
204
|
bq_client = initialize_bq_client(credentials, args.project_id)
|
182
205
|
if args.project_id is None:
|
183
206
|
args.project_id = json.loads(args.credentials_json)["project_id"]
|
quollio_core/bricks.py
CHANGED
@@ -3,7 +3,7 @@ import logging
|
|
3
3
|
import os
|
4
4
|
import shutil
|
5
5
|
|
6
|
-
from quollio_core.helper.core import setup_dbt_profile, trim_prefix
|
6
|
+
from quollio_core.helper.core import is_valid_domain, setup_dbt_profile, trim_prefix
|
7
7
|
from quollio_core.helper.env_default import env_default
|
8
8
|
from quollio_core.helper.log import set_log_level
|
9
9
|
from quollio_core.profilers.databricks import (
|
@@ -13,7 +13,7 @@ from quollio_core.profilers.databricks import (
|
|
13
13
|
)
|
14
14
|
from quollio_core.profilers.stats import get_column_stats_items
|
15
15
|
from quollio_core.repository import databricks as db
|
16
|
-
from quollio_core.repository import dbt, qdc
|
16
|
+
from quollio_core.repository import dbt, qdc, ssm
|
17
17
|
|
18
18
|
logger = logging.getLogger(__name__)
|
19
19
|
|
@@ -256,6 +256,16 @@ if __name__ == "__main__":
|
|
256
256
|
required=False,
|
257
257
|
help="Whether to ingest column lineage into QDIC or not. Default value is False",
|
258
258
|
)
|
259
|
+
parser.add_argument(
|
260
|
+
"--external_api_access",
|
261
|
+
type=str,
|
262
|
+
choices=["PUBLIC", "VPC_ENDPOINT"],
|
263
|
+
action=env_default("EXTERNAL_API_ACCESS"),
|
264
|
+
default="PUBLIC",
|
265
|
+
required=False,
|
266
|
+
help="Access method to Quollio API. Default 'PUBLIC'. Choose 'VPC_ENDPOINT'\
|
267
|
+
if you use API Gateway VPC Endpoint, DefaultValue is set to PUBLIC.",
|
268
|
+
)
|
259
269
|
|
260
270
|
stats_items = get_column_stats_items()
|
261
271
|
parser.add_argument(
|
@@ -294,9 +304,21 @@ if __name__ == "__main__":
|
|
294
304
|
dbt_macro_source=args.dbt_macro_source,
|
295
305
|
)
|
296
306
|
|
307
|
+
api_url = args.api_url
|
308
|
+
if args.external_api_access == "VPC_ENDPOINT":
|
309
|
+
logger.debug("Using VPC Endpoint for Quollio API access")
|
310
|
+
api_url, err = ssm.get_parameter_by_assume_role(args.api_url)
|
311
|
+
if err is not None:
|
312
|
+
logger.error("Fail to ssm.get_parameter_by_assume_role. {err}".format(err=err))
|
313
|
+
raise Exception("Fail to ssm.get_parameter_by_assume_role. {err}".format(err=err))
|
314
|
+
is_domain_valid = is_valid_domain(domain=api_url, domain_type=args.external_api_access)
|
315
|
+
if not is_domain_valid:
|
316
|
+
raise ValueError("The format of quollio API URL is invalid. The URL must end with `.com` or /api.")
|
317
|
+
logger.debug("API URL: %s", api_url)
|
318
|
+
|
297
319
|
if "load_lineage" in args.commands:
|
298
320
|
qdc_client = qdc.QDCExternalAPIClient(
|
299
|
-
base_url=
|
321
|
+
base_url=api_url, client_id=args.client_id, client_secret=args.client_secret
|
300
322
|
)
|
301
323
|
load_lineage(
|
302
324
|
conn=conn,
|
@@ -308,7 +330,7 @@ if __name__ == "__main__":
|
|
308
330
|
|
309
331
|
if "load_stats" in args.commands:
|
310
332
|
qdc_client = qdc.QDCExternalAPIClient(
|
311
|
-
base_url=
|
333
|
+
base_url=api_url, client_id=args.client_id, client_secret=args.client_secret
|
312
334
|
)
|
313
335
|
databricks_column_stats(
|
314
336
|
conn=conn,
|
quollio_core/redshift.py
CHANGED
@@ -356,13 +356,15 @@ if __name__ == "__main__":
|
|
356
356
|
|
357
357
|
api_url = args.api_url
|
358
358
|
if args.external_api_access == "VPC_ENDPOINT":
|
359
|
+
logger.debug("Using VPC Endpoint for Quollio API access")
|
359
360
|
api_url, err = ssm.get_parameter_by_assume_role(args.api_url)
|
360
361
|
if err is not None:
|
361
362
|
logger.error("Fail to ssm.get_parameter_by_assume_role. {err}".format(err=err))
|
362
363
|
raise Exception("Fail to ssm.get_parameter_by_assume_role. {err}".format(err=err))
|
363
364
|
is_domain_valid = is_valid_domain(domain=api_url, domain_type=args.external_api_access)
|
364
365
|
if not is_domain_valid:
|
365
|
-
raise ValueError("The format of quollio API URL is invalid. The URL must end with `.com`")
|
366
|
+
raise ValueError("The format of quollio API URL is invalid. The URL must end with `.com` or /api.")
|
367
|
+
logger.debug("API URL: %s", api_url)
|
366
368
|
|
367
369
|
if "load_lineage" in args.commands:
|
368
370
|
qdc_client = qdc.QDCExternalAPIClient(
|
quollio_core/snowflake.py
CHANGED
@@ -443,6 +443,7 @@ if __name__ == "__main__":
|
|
443
443
|
)
|
444
444
|
api_url = args.api_url
|
445
445
|
if args.external_api_access == "VPC_ENDPOINT":
|
446
|
+
logger.debug("Using VPC Endpoint for Quollio API access")
|
446
447
|
api_url, err = ssm.get_parameter_by_assume_role(args.api_url)
|
447
448
|
if err is not None:
|
448
449
|
logger.error("Fail to ssm.get_parameter_by_assume_role. {err}".format(err=err))
|
@@ -450,7 +451,8 @@ if __name__ == "__main__":
|
|
450
451
|
|
451
452
|
is_domain_valid = is_valid_domain(domain=api_url, domain_type=args.external_api_access)
|
452
453
|
if not is_domain_valid:
|
453
|
-
raise ValueError("The format of quollio API URL is invalid. The URL must end with `.com`")
|
454
|
+
raise ValueError("The format of quollio API URL is invalid. The URL must end with `.com` or /api.")
|
455
|
+
logger.debug("API URL: %s", api_url)
|
454
456
|
|
455
457
|
if "load_lineage" in args.commands:
|
456
458
|
qdc_client = qdc.QDCExternalAPIClient(
|
quollio_core/teradata.py
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
import argparse
|
2
2
|
import json
|
3
3
|
|
4
|
+
from quollio_core.helper.core import is_valid_domain
|
4
5
|
from quollio_core.helper.env_default import env_default
|
5
6
|
from quollio_core.helper.log_utils import configure_logging, error_handling_decorator, logger
|
6
7
|
from quollio_core.profilers.stats import get_column_stats_items
|
7
8
|
from quollio_core.profilers.teradata.lineage import load_lineage
|
8
9
|
from quollio_core.profilers.teradata.stats import load_stats
|
9
|
-
from quollio_core.repository import qdc
|
10
|
+
from quollio_core.repository import qdc, ssm
|
10
11
|
from quollio_core.repository import teradata as teradata_repo
|
11
12
|
|
12
13
|
DEFAULT_SYSTEM_DATABASES = [
|
@@ -197,6 +198,16 @@ def main() -> None:
|
|
197
198
|
help="Name of the Teradata system database.\
|
198
199
|
Default is DBC",
|
199
200
|
)
|
201
|
+
parser.add_argument(
|
202
|
+
"--external_api_access",
|
203
|
+
type=str,
|
204
|
+
choices=["PUBLIC", "VPC_ENDPOINT"],
|
205
|
+
action=env_default("EXTERNAL_API_ACCESS"),
|
206
|
+
default="PUBLIC",
|
207
|
+
required=False,
|
208
|
+
help="Access method to Quollio API. Default 'PUBLIC'. Choose 'VPC_ENDPOINT'\
|
209
|
+
if you use API Gateway VPC Endpoint, DefaultValue is set to PUBLIC.",
|
210
|
+
)
|
200
211
|
|
201
212
|
args = parser.parse_args()
|
202
213
|
|
@@ -217,7 +228,19 @@ def main() -> None:
|
|
217
228
|
additional_params = {}
|
218
229
|
|
219
230
|
logger.info("Initializing QDC client")
|
220
|
-
|
231
|
+
api_url = args.api_url
|
232
|
+
if args.external_api_access == "VPC_ENDPOINT":
|
233
|
+
logger.debug("Using VPC Endpoint for Quollio API access")
|
234
|
+
api_url, err = ssm.get_parameter_by_assume_role(args.api_url)
|
235
|
+
if err is not None:
|
236
|
+
logger.error("Fail to ssm.get_parameter_by_assume_role. {err}".format(err=err))
|
237
|
+
raise Exception("Fail to ssm.get_parameter_by_assume_role. {err}".format(err=err))
|
238
|
+
is_domain_valid = is_valid_domain(domain=api_url, domain_type=args.external_api_access)
|
239
|
+
if not is_domain_valid:
|
240
|
+
raise ValueError("The format of quollio API URL is invalid. The URL must end with `.com` or /api.")
|
241
|
+
|
242
|
+
logger.debug("API URL: %s", api_url)
|
243
|
+
qdc_client = qdc.initialize_qdc_client(api_url, args.client_id, args.client_secret)
|
221
244
|
|
222
245
|
logger.info("Initializing Teradata client")
|
223
246
|
config = teradata_repo.TeradataConfig.from_dict(
|
@@ -1,14 +1,13 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: quollio-core
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.8.0
|
4
4
|
Summary: Quollio Core
|
5
5
|
Author-email: quollio-dev <qt.dev@quollio.com>
|
6
6
|
Maintainer-email: RyoAriyama <ryo.arym@gmail.com>, tharuta <35373297+TakumiHaruta@users.noreply.github.com>
|
7
|
-
Requires-Python: >=3.
|
7
|
+
Requires-Python: >=3.9
|
8
8
|
Description-Content-Type: text/markdown
|
9
9
|
Classifier: Programming Language :: Python
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
11
|
-
Classifier: Programming Language :: Python :: 3.8
|
12
11
|
Classifier: Programming Language :: Python :: 3.9
|
13
12
|
Classifier: Programming Language :: Python :: 3.10
|
14
13
|
Classifier: Programming Language :: Python :: 3.11
|
@@ -29,7 +28,7 @@ Requires-Dist: PyYAML==6.0.1
|
|
29
28
|
Requires-Dist: requests==2.31.0
|
30
29
|
Requires-Dist: pyjwt==2.8.0
|
31
30
|
Requires-Dist: redshift-connector==2.0.915
|
32
|
-
Requires-Dist: snowflake-connector-python==3.
|
31
|
+
Requires-Dist: snowflake-connector-python==3.15.0
|
33
32
|
Requires-Dist: databricks-sdk==0.17.0
|
34
33
|
Requires-Dist: databricks-sql-connector==2.9.5
|
35
34
|
Requires-Dist: sqlglot==20.8.0
|
@@ -1,9 +1,9 @@
|
|
1
|
-
quollio_core/__init__.py,sha256=
|
2
|
-
quollio_core/bigquery.py,sha256=
|
3
|
-
quollio_core/bricks.py,sha256=
|
4
|
-
quollio_core/redshift.py,sha256=
|
5
|
-
quollio_core/snowflake.py,sha256=
|
6
|
-
quollio_core/teradata.py,sha256=
|
1
|
+
quollio_core/__init__.py,sha256=6mrUIczxbYjfsjNKGODKEqgfY2fJGaL98zEXIgsuIsQ,83
|
2
|
+
quollio_core/bigquery.py,sha256=xtLMuURkf8-Pak72Pv0XWu-ljhdIoyHQGko3aqsfMuM,7968
|
3
|
+
quollio_core/bricks.py,sha256=frndLVGMlds-HthOPx9W4ULm5u-SLrC_2gLlhch2jIc,11890
|
4
|
+
quollio_core/redshift.py,sha256=_7c7No9hqIjaIY4l0lDSR6vFZR9dHZWC0SzTZY8eTt8,13308
|
5
|
+
quollio_core/snowflake.py,sha256=NkEM1qh-0XStmxCGqosRB7lyhrvVEULViRVc4lfOhpY,17200
|
6
|
+
quollio_core/teradata.py,sha256=KGJhel93BbISsjaEX2s_WlbGAKKY0RfhmYcBlLNYqyo,9374
|
7
7
|
quollio_core/dbt_projects/databricks/.gitignore,sha256=1jJAyXSzJ3YUm0nx3i7wUSE4RjQMX3ad6F8O88UbtzI,29
|
8
8
|
quollio_core/dbt_projects/databricks/README.md,sha256=ZpRQyhFAODAiS8dc1Kb_ndkul4cu4o4udN_EMa49CU4,440
|
9
9
|
quollio_core/dbt_projects/databricks/dbt_project.yml,sha256=3sH98RNk7TnphvI3yEdXDstb92kW5BNxr-cT0tXhwzk,480
|
@@ -91,7 +91,7 @@ quollio_core/repository/redshift.py,sha256=p2ouEuYcDCjx1oBhc6H1ekQsvEqHGd3bFu3PW
|
|
91
91
|
quollio_core/repository/snowflake.py,sha256=yCYXrYf4I5GL_ITNTXoggj0xNbQsdwxPSmsVvZYwUVU,3869
|
92
92
|
quollio_core/repository/ssm.py,sha256=xpm1FzbBnIsBptuYPUNnPgkKU2AH3XxI-ZL0bEetvW0,2182
|
93
93
|
quollio_core/repository/teradata.py,sha256=1AExxRBTswpSyF4OVyAUkoiZ0yVRfqt4T99FdllkTEI,3763
|
94
|
-
quollio_core-0.
|
95
|
-
quollio_core-0.
|
96
|
-
quollio_core-0.
|
97
|
-
quollio_core-0.
|
94
|
+
quollio_core-0.8.0.dist-info/licenses/LICENSE,sha256=V8j_M8nAz8PvAOZQocyRDX7keai8UJ9skgmnwqETmdY,34520
|
95
|
+
quollio_core-0.8.0.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
96
|
+
quollio_core-0.8.0.dist-info/METADATA,sha256=qnCGNGgKGLVygYs4Fwai0sSJtunwVwQUfS6WIjiQdUU,6974
|
97
|
+
quollio_core-0.8.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|