gen3-dataops-toolkit 2.1.1__tar.gz → 2.1.2__tar.gz
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.
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/PKG-INFO +1 -1
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/pyproject.toml +1 -1
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/cli/release_cmds.py +8 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/utils/athena_utils.py +19 -6
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/utils/release_writer.py +11 -2
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/README.md +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/__init__.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/cli/__init__.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/cli/_internal/__init__.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/cli/_internal/dispatch.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/cli/_internal/registry.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/cli/_internal/resolve.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/cli/_internal/runner.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/cli/_internal/safety.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/cli/config_cmds.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/cli/delete_cmds.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/cli/dict_cmds.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/cli/ec2_cmds.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/cli/indexd_cmds.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/cli/jobs.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/cli/k8s.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/cli/main.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/cli/metadata.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/cli/pipeline_cmds.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/cli/synth.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/config.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/indexd/__init__.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/indexd/indexd_registrar.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/ingest/ingest.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/resolver.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/services/delete/delete_all_metadata_for_project.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/services/delete/delete_metadata.sh +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/services/delete/delete_metadata_by_guid.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/services/dictionary/deploy_dd.sh +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/services/dictionary/pull_dict.sh +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/services/dictionary/upload_dictionary.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/services/indexd/register_indexd.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/services/k8s_ops/argocd_restart_etl.sh +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/services/k8s_ops/argocd_restart_ms.sh +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/services/k8s_ops/argocd_restart_schema.sh +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/services/k8s_ops/login_to_pod.sh +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/services/k8s_ops/restart_etl_and_ms.sh +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/services/synthetic_data/delete_synth_metadata_sheepdog.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/services/synthetic_data/full_deploy_dd_and_synth.sh +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/services/synthetic_data/generate_synth_metadata.sh +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/services/synthetic_data/upload_synth_metadata_sheepdog.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/services/upload/metadata/upload_all_studies.sh +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/services/upload/metadata/upload_metadata.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/upload/__init__.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/upload/metadata_deleter.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/upload/metadata_submitter.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/upload/upload_synthdata_s3.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/utils/dbt_utils.py +0 -0
- {gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/validate/validate.py +0 -0
|
@@ -55,6 +55,12 @@ def write(
|
|
|
55
55
|
f"(workgroup output {rc.athena_output_location})",
|
|
56
56
|
bold=True,
|
|
57
57
|
)
|
|
58
|
+
# The env's own silver/gold DBs (from SSM) scope the model->DB search:
|
|
59
|
+
# deterministic in shared accounts, no account-wide Glue perms needed.
|
|
60
|
+
search_databases = [
|
|
61
|
+
db for db in (rc.get("glue/db/rawSilver"), rc.get("glue/db/rawGold"))
|
|
62
|
+
if db
|
|
63
|
+
] or None
|
|
58
64
|
release_writer.run(
|
|
59
65
|
dbt_schema_path=dbt_schema_path,
|
|
60
66
|
release_db=rc.release_db,
|
|
@@ -65,6 +71,8 @@ def write(
|
|
|
65
71
|
aws_region=rc.region,
|
|
66
72
|
athena_s3_output=rc.athena_output_location,
|
|
67
73
|
aws_profile=profile,
|
|
74
|
+
workgroup=rc.athena_workgroup,
|
|
75
|
+
search_databases=search_databases,
|
|
68
76
|
dry_run=dry_run,
|
|
69
77
|
)
|
|
70
78
|
except config.ConfigError as exc:
|
|
@@ -26,10 +26,14 @@ class AthenaConfig:
|
|
|
26
26
|
aws_region (str): AWS region for Athena and S3 operations.
|
|
27
27
|
aws_profile (str): AWS profile to use for authentication.
|
|
28
28
|
athena_s3_output (str): S3 location for Athena query output.
|
|
29
|
+
workgroup (str, optional): Athena workgroup to run queries in. Roles on
|
|
30
|
+
the platform are scoped to the env's workgroup, so leaving this
|
|
31
|
+
unset (awswrangler defaults to 'primary') fails under them.
|
|
29
32
|
"""
|
|
30
33
|
aws_region: str
|
|
31
34
|
aws_profile: str
|
|
32
35
|
athena_s3_output: str
|
|
36
|
+
workgroup: Optional[str] = None
|
|
33
37
|
|
|
34
38
|
def as_dict(self) -> Dict[str, Any]:
|
|
35
39
|
return {
|
|
@@ -87,13 +91,16 @@ class AthenaQuery:
|
|
|
87
91
|
logger.info(f"Running Athena query: {sql}")
|
|
88
92
|
boto3_session = self._get_boto_session()
|
|
89
93
|
try:
|
|
90
|
-
|
|
94
|
+
kwargs = dict(
|
|
91
95
|
sql=sql,
|
|
92
96
|
boto3_session=boto3_session,
|
|
93
97
|
database=athena_database,
|
|
94
98
|
ctas_approach=ctas_approach,
|
|
95
|
-
s3_output=self.config.athena_s3_output
|
|
99
|
+
s3_output=self.config.athena_s3_output,
|
|
96
100
|
)
|
|
101
|
+
if getattr(self.config, "workgroup", None):
|
|
102
|
+
kwargs["workgroup"] = self.config.workgroup
|
|
103
|
+
df = wr.athena.read_sql_query(**kwargs)
|
|
97
104
|
logger.info(
|
|
98
105
|
f"Athena query completed successfully. Returned {len(df)} rows."
|
|
99
106
|
)
|
|
@@ -159,7 +166,7 @@ class AthenaQuery:
|
|
|
159
166
|
database=athena_database,
|
|
160
167
|
table=table_name,
|
|
161
168
|
boto3_session=boto3_session,
|
|
162
|
-
workgroup='primary',
|
|
169
|
+
workgroup=getattr(self.config, "workgroup", None) or 'primary',
|
|
163
170
|
temp_path=temp_s3_path
|
|
164
171
|
)
|
|
165
172
|
logger.info(
|
|
@@ -172,7 +179,7 @@ class AthenaQuery:
|
|
|
172
179
|
)
|
|
173
180
|
raise
|
|
174
181
|
|
|
175
|
-
def find_db_for_model(self, model_name: str) -> Optional[str]:
|
|
182
|
+
def find_db_for_model(self, model_name: str, databases: Optional[list] = None) -> Optional[str]:
|
|
176
183
|
"""
|
|
177
184
|
Search all Athena databases for a table with the given name and return the database name if found.
|
|
178
185
|
|
|
@@ -202,8 +209,14 @@ class AthenaQuery:
|
|
|
202
209
|
try:
|
|
203
210
|
# Create a session and pass it to wrangler
|
|
204
211
|
boto3_session = self._get_boto_session()
|
|
205
|
-
|
|
206
|
-
|
|
212
|
+
if databases:
|
|
213
|
+
# Scoped search (e.g. the env's own silver/gold DBs from SSM):
|
|
214
|
+
# deterministic in shared accounts and needs no account-wide
|
|
215
|
+
# Glue permissions.
|
|
216
|
+
db_list = list(databases)
|
|
217
|
+
else:
|
|
218
|
+
all_dbs = wr.catalog.databases(boto3_session=boto3_session)
|
|
219
|
+
db_list = all_dbs.get('Database', [])
|
|
207
220
|
for db in db_list:
|
|
208
221
|
try:
|
|
209
222
|
# Pass the session to other wrangler calls too
|
|
@@ -143,6 +143,10 @@ def parse_args():
|
|
|
143
143
|
help="S3 URI for Athena query results (e.g., 's3://athena-results-bucket/').")
|
|
144
144
|
parser.add_argument("--release-s3-location", type=str, required=True,
|
|
145
145
|
help="S3 location for the release table (e.g., 's3://<metadata-bucket>/').")
|
|
146
|
+
parser.add_argument("--workgroup", type=str, required=False,
|
|
147
|
+
help="Athena workgroup to run queries in (platform roles are workgroup-scoped).")
|
|
148
|
+
parser.add_argument("--search-database", action="append", default=None,
|
|
149
|
+
help="Restrict the model->database search to this DB (repeatable).")
|
|
146
150
|
parser.add_argument("--dry-run", action="store_true", default=False,
|
|
147
151
|
help="Resolve everything and log the SQL; write nothing.")
|
|
148
152
|
parser.add_argument("-v", "--verbose", action="store_true", default=False,
|
|
@@ -161,6 +165,8 @@ def run(
|
|
|
161
165
|
aws_region: str,
|
|
162
166
|
athena_s3_output: str,
|
|
163
167
|
aws_profile: Optional[str] = None,
|
|
168
|
+
workgroup: Optional[str] = None,
|
|
169
|
+
search_databases: Optional[list] = None,
|
|
164
170
|
dry_run: bool = False,
|
|
165
171
|
) -> None:
|
|
166
172
|
"""Write one release row per dbt model (idempotent; see insert_release_row).
|
|
@@ -176,7 +182,8 @@ def run(
|
|
|
176
182
|
athena_config = AthenaConfig(
|
|
177
183
|
aws_region=aws_region,
|
|
178
184
|
aws_profile=aws_profile,
|
|
179
|
-
athena_s3_output=athena_s3_output
|
|
185
|
+
athena_s3_output=athena_s3_output,
|
|
186
|
+
workgroup=workgroup,
|
|
180
187
|
)
|
|
181
188
|
|
|
182
189
|
dbt_models = get_model_names(dbt_schema_path)
|
|
@@ -197,7 +204,7 @@ def run(
|
|
|
197
204
|
|
|
198
205
|
for model_name in dbt_models:
|
|
199
206
|
logger.info(f"--- Processing model: {model_name}")
|
|
200
|
-
db_name = athena_query.find_db_for_model(model_name)
|
|
207
|
+
db_name = athena_query.find_db_for_model(model_name, databases=search_databases)
|
|
201
208
|
if not db_name:
|
|
202
209
|
logger.warning(f"Database not found for model '{model_name}'. Skipping...")
|
|
203
210
|
continue
|
|
@@ -239,6 +246,8 @@ def main():
|
|
|
239
246
|
aws_region=args.aws_region,
|
|
240
247
|
athena_s3_output=args.athena_s3_output,
|
|
241
248
|
aws_profile=args.aws_profile,
|
|
249
|
+
workgroup=args.workgroup,
|
|
250
|
+
search_databases=args.search_database,
|
|
242
251
|
dry_run=args.dry_run,
|
|
243
252
|
)
|
|
244
253
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/cli/_internal/__init__.py
RENAMED
|
File without changes
|
{gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/cli/_internal/dispatch.py
RENAMED
|
File without changes
|
{gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/cli/_internal/registry.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/indexd/indexd_registrar.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/services/dictionary/deploy_dd.sh
RENAMED
|
File without changes
|
{gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/services/dictionary/pull_dict.sh
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/services/k8s_ops/login_to_pod.sh
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/upload/metadata_deleter.py
RENAMED
|
File without changes
|
{gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/upload/metadata_submitter.py
RENAMED
|
File without changes
|
{gen3_dataops_toolkit-2.1.1 → gen3_dataops_toolkit-2.1.2}/src/g3dt/upload/upload_synthdata_s3.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|