Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/2.24.7 #25

Merged
merged 125 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
dea50a0
feat(pdf): Test Result PDF report
rboni-dk Sep 27, 2024
764bd12
misc(ui): enhancements to button, link and flex widgets
aarthy-dk Sep 26, 2024
bed5d1c
refactor(ui): rename "toolbar_select" widget to generic "select"
aarthy-dk Sep 26, 2024
15b3941
feat(ui): add empty_state widget
aarthy-dk Sep 26, 2024
2048bba
refactor(dialogs): move execution dialogs to separate files
aarthy-dk Sep 26, 2024
5c1de82
feat(ui): add empty state messaging and links/actions to all top-leve…
aarthy-dk Sep 26, 2024
40b24e9
misc(ui): disable buttons when not relevant and styling improvements
aarthy-dk Sep 26, 2024
4826fc9
style(ui): lint changed files
aarthy-dk Sep 26, 2024
0cf62ac
fix(ui): update empty state widget
aarthy-dk Sep 30, 2024
330aca1
feat(pdf): Improving the PDF report aesthetics
rboni-dk Oct 1, 2024
a575af2
Merge branch 'aarthy/empty-state' into 'enterprise'
aarthy-dk Oct 3, 2024
f8e26f3
refactor(ui): improvements to vanjs components to support page compon…
aarthy-dk Oct 3, 2024
dc968b5
refactor(ui): use page components in test runs and profiling runs
aarthy-dk Oct 3, 2024
0d749e9
refactor(ui): improve and abstract event handling from page components
aarthy-dk Oct 4, 2024
79c708f
fix(ui): handle height of page components responsively
aarthy-dk Oct 4, 2024
f082c0a
style: improve typing
aarthy-dk Oct 4, 2024
77f107e
feat(pdf): Refacoring the code and fixing the header
rboni-dk Oct 5, 2024
769681d
Merge branch 'aarthy/page-component' into 'enterprise'
Oct 7, 2024
ad724e7
mic(pdf): Addressing team feedback
rboni-dk Oct 8, 2024
2f6c43b
mic(pdf): Adding a progress bar to the download dialog
rboni-dk Oct 9, 2024
f0e2ae9
Merge branch 'enterprise' of gitlab.com:dkinternal/testgen/dataops-te…
rboni-dk Oct 9, 2024
7c1aa58
fix(upgrade): add where clause in sql update statements with joins
aarthy-dk Oct 9, 2024
6d9d966
Merge branch 'aarthy/fix-upgrade' into 'enterprise'
Oct 9, 2024
deaf648
fix(pdf): Fixing the data table header aligment plus some other impro…
rboni-dk Oct 10, 2024
0cfd448
Merge branch 'enterprise' of gitlab.com:dkinternal/testgen/dataops-te…
rboni-dk Oct 10, 2024
5696b06
fix(pdf): Addressing code review feedback
rboni-dk Oct 10, 2024
f1147b1
Merge branch 'tg-812' into 'enterprise'
rboni-dk Oct 10, 2024
e3a1311
fix(auth): handle cookies retrieved inconsistently
aarthy-dk Oct 10, 2024
e9121f6
Merge branch 'aarthy/cookies' into 'enterprise'
Oct 10, 2024
a86be02
fix(misc): Download dialog code cleanup (close, progress)
rboni-dk Oct 14, 2024
98319b0
Merge branch 'tg-812-dialog' into 'enterprise'
rboni-dk Oct 15, 2024
442f6e3
Merge branch 'main' into 'enterprise'
aarthy-dk Oct 15, 2024
65fa528
Merge branch 'main' into sync
aarthy-dk Oct 17, 2024
86a04df
Merge branch 'sync' into 'enterprise'
Oct 18, 2024
26d019d
astor/TG-806
FernandezAstor Oct 21, 2024
7555216
feat(ui): bind grid selection to query parameters
luis-dk Oct 23, 2024
eb3f71a
fix(ui): send the selection ID to AGgrid
luis-dk Oct 28, 2024
8b7b0c8
Merge branch 'tg-818-grid-selection' into 'enterprise'
Oct 29, 2024
6b16b53
TG-777: Inline SQL functions and remove profiling setup
Oct 31, 2024
acb1085
Merge branch 'TG-777' into 'enterprise'
diogodk Oct 31, 2024
8451e74
fix(overview): truncate tests percentage
luis-dk Oct 31, 2024
716ff8a
feat(overview): add sort dropdown for table groups list
luis-dk Oct 31, 2024
fd076da
feat(overview): add input field to filter table groups list
luis-dk Oct 31, 2024
69d490b
fix(overview): sort by latest activity date instead of dual sorting
luis-dk Nov 1, 2024
36da100
Merge branch 'tg-822-overview' into 'enterprise'
Nov 1, 2024
493d4c3
feat(connections): use the new wizard for setting up table groups
luis-dk Oct 17, 2024
4d11dc1
feat(ui): add a database flavor selector component
luis-dk Oct 22, 2024
25ac0f5
fix(ui): Add streamlit-pydantic to list of dependencies
luis-dk Oct 24, 2024
9ee6bd2
fix: python 3.10 compatibility and missing import
luis-dk Oct 24, 2024
3b84e6a
fix(connections): use the flavor form when parsing validation errors
luis-dk Oct 28, 2024
39aa35c
misc(ui): add white background to custom link
luis-dk Oct 29, 2024
5e0ec9a
misc(ui): add db flavor icons for azure sql and synapse
luis-dk Oct 29, 2024
a6e20a7
fix(connections): display cached value for private key file uploader
luis-dk Oct 31, 2024
372c12b
fix(ui): use index instead of value in flavor selector
luis-dk Nov 1, 2024
1a167b8
fix: sleep to protect against multiple reruns
luis-dk Nov 5, 2024
d25bce8
misc: remove qc schema creation logic
luis-dk Nov 5, 2024
10c612e
fix(profiling): add parenthesis to profiling issue criteria
luis-dk Nov 6, 2024
9a071ff
Merge branch 'issues-count-fix' into 'enterprise'
Nov 6, 2024
e64d20a
misc(profiling): remove qc schema creation logic
luis-dk Nov 7, 2024
b463905
Merge branch 'setup-wizard' into 'enterprise'
Nov 7, 2024
66ca55d
feat(pdf): Hygiene Issues report
rboni-dk Oct 29, 2024
a67078b
refactor(components): upgrade vanJS to latest version
aarthy-dk Nov 4, 2024
41b25c1
refactor(tooltip): support tooltip positions - add to button and tool…
aarthy-dk Nov 4, 2024
eee533c
feat(link): support opening links in new tabs
aarthy-dk Nov 4, 2024
ab08ba2
misc(summary): add legend colors to summary bar component
aarthy-dk Nov 4, 2024
58ca5a7
feat(components): add BoxPlot, PercentBar and FrequencyBars components
aarthy-dk Nov 4, 2024
6f1f595
feat(components): add Attribute, Card and EditableCard components
aarthy-dk Nov 4, 2024
b8cb63a
feat(components): add Input, Checkbox and RadioGroup components
aarthy-dk Nov 4, 2024
d87f69c
feat(components): add Tree component
aarthy-dk Nov 4, 2024
fd343eb
feat(components): add ColumnProfile component
aarthy-dk Nov 4, 2024
b1bf3ea
feat(ui): add Data Hierarchy page
aarthy-dk Nov 4, 2024
5ce267f
misc(ui): fixes and typing improvements
aarthy-dk Nov 4, 2024
9fa43f1
misc(ui): improve data hierarchy query performance
aarthy-dk Nov 6, 2024
26e23b5
Merge branch 'aarthy/data-hierarchy' into 'enterprise'
Nov 7, 2024
fc6cb63
fix(threshold error count fix): code fixes
FernandezAstor Nov 7, 2024
1113bcd
fix: threshold error count
FernandezAstor Nov 7, 2024
0069270
ci(docker): add git to dockerfile
aarthy-dk Nov 7, 2024
8f66c46
Merge branch 'fix-build' into 'enterprise'
Nov 7, 2024
c37ff38
Merge branch 'astor/TG-806' into 'enterprise'
FernandezAstor Nov 8, 2024
776d2b3
fix(profiling): add parenthesis to the formatted anomaly criteria
luis-dk Nov 7, 2024
0a97887
Merge branch 'profile-query-parentheses' into 'enterprise'
Nov 8, 2024
d919890
Merge branch 'enterprise' of gitlab.com:dkinternal/testgen/dataops-te…
rboni-dk Nov 11, 2024
9521759
misc(pdf): Code review feedback
rboni-dk Nov 11, 2024
4e063da
Merge branch 'tg-817' into 'enterprise'
rboni-dk Nov 11, 2024
f5ba879
feat(cli): add scoring infrastructure and default score roll-ups
cbloche Nov 8, 2024
c54266b
Tweaked Functional Datatypes
cbloche Nov 11, 2024
b623679
Tweaked Incremental Upgrade
cbloche Nov 11, 2024
bde97ca
Incremental upgrade fix
cbloche Nov 11, 2024
6603837
Merge branch 'chip/scoring_phase_1B' into 'enterprise'
Nov 11, 2024
b9b1743
fix(ui): Adding database icons to the python built package
rboni-dk Nov 12, 2024
6cbad51
Merge branch 'fix-ui-missing-assets' into 'enterprise'
rboni-dk Nov 12, 2024
bd32353
fix(ui): add table and column filters to hygiene issues and test results
aarthy-dk Nov 8, 2024
6116f3b
fix(ui): add dk favicon to image
aarthy-dk Nov 8, 2024
b8a94b3
feat(ui): add community and training links to header
aarthy-dk Nov 11, 2024
7b51a95
misc(ui): improve query performance with new fields
aarthy-dk Nov 12, 2024
49bda82
Merge branch 'aarthy/filters' into 'enterprise'
Nov 12, 2024
8a5593b
ci(tests): fix functional tests
aarthy-dk Nov 12, 2024
3a8d9e3
Merge branch 'fix-tests' into 'enterprise'
Nov 12, 2024
5be063c
fix(ui): error on login screen
aarthy-dk Nov 12, 2024
8390a16
feat(pdf): add link backs to pdf issue reports
aarthy-dk Nov 13, 2024
9c2848e
fix(runs): increase sleep before closing run dialogs
aarthy-dk Nov 13, 2024
7d78958
fix(ui): deep-linking on test results page
aarthy-dk Nov 13, 2024
6593ddf
fix(ui): update bind query js syntax
aarthy-dk Nov 13, 2024
e05385e
Merge branch 'qa-fixes' into 'enterprise'
Nov 13, 2024
726bd9a
fix(profiling): TG-774 - disable profiling dialog for multi-table res…
FernandezAstor Nov 14, 2024
fca069b
fix(functions): Strip out comments when loading templated functions
rboni-dk Nov 14, 2024
ff504be
Merge branch 'astor/TG-774' into 'enterprise'
Nov 14, 2024
973bb4a
fix(ui): bug fixes on test results and connection wizard
aarthy-dk Nov 13, 2024
a4729ef
fix(pdf): make file names unique when zipping multiple
aarthy-dk Nov 15, 2024
c8f1cd2
refactor: cleanup references to qc schema
aarthy-dk Nov 15, 2024
b31bed3
Merge branch 'qa-fixes' into 'enterprise'
Nov 15, 2024
da6e23a
fix(ui): bug in format duration utility
aarthy-dk Nov 18, 2024
c690125
fix(data-hierarchy): add selected query param to test issue link
aarthy-dk Nov 19, 2024
524218e
fix(sql): bug in source data dialog
aarthy-dk Nov 20, 2024
926b8a1
fix(ui): deep links intermittently don't work
aarthy-dk Nov 20, 2024
666b447
misc: change level of repetitive docker check log
aarthy-dk Nov 20, 2024
b2d5bda
Merge branch 'qa-fixes' into 'enterprise'
Nov 20, 2024
c55e04b
fix(sql): escape special characters in pattern match test
aarthy-dk Nov 21, 2024
bd64e67
Merge branch 'enterprise' of gitlab.com:dkinternal/testgen/dataops-te…
rboni-dk Nov 22, 2024
7b81575
Merge branch 'aarthy/pattern-match' into 'enterprise'
Nov 22, 2024
078e08c
Merge branch 'tg-830' into 'enterprise'
rboni-dk Nov 22, 2024
fbaa6be
fix(overview): error when profiling date exists but no test date
aarthy-dk Nov 22, 2024
637dce8
Merge branch 'aarthy/overview-bug' into 'enterprise'
Nov 23, 2024
374a5d5
fix(sql): special characters in pattern match test
aarthy-dk Nov 23, 2024
62386b3
release: 2.15.3 -> 2.24.7
aarthy-dk Nov 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM python:3.10-slim-bookworm AS build-image

RUN mkdir -p /dk && \
apt-get update && \
apt-get install -y gcc libpcre3 libpcre3-dev g++
apt-get install -y gcc libpcre3 libpcre3-dev g++ git

COPY ./pyproject.toml /tmp/dk/
RUN python3 -m pip install /tmp/dk --prefix=/dk
Expand Down
6 changes: 0 additions & 6 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,6 @@ Determine how many tests are grouped together in a single query. Increase for be

default: `5000`

#### `PROJECT_QC_SCHEMA`

Name of the schema to be created in the project database.

default: `qc`

#### `PROJECT_DATABASE_NAME`

Name of the database the auto generated project will run test against.
Expand Down
13 changes: 9 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "dataops-testgen"
version = "2.15.3"
version = "2.24.7"
description = "DataKitchen's Data Quality DataOps TestGen"
authors = [
{ "name" = "DataKitchen, Inc.", "email" = "info@datakitchen.io" },
Expand All @@ -32,6 +32,7 @@ requires-python = ">=3.10"
dependencies = [
"PyYAML==6.0.1",
"click==8.1.3",
"regex==2024.9.11",
"sqlalchemy==1.4.46",
"snowflake-sqlalchemy==1.4.7",
"pyodbc==5.0.0",
Expand Down Expand Up @@ -60,6 +61,8 @@ dependencies = [
"concurrent_log_handler==0.9.25",
"cryptography==42.0.8",
"validators==0.33.0",
"reportlab==4.2.2",
"streamlit-pydantic @ git+https://github.com/LukasMasuch/streamlit-pydantic.git@9f84145b6b6e74cdff3a7815ab75b0464c4d4f24",
]

[project.optional-dependencies]
Expand Down Expand Up @@ -99,7 +102,7 @@ include-package-data = true
[tool.setuptools.package-data]
"*" = ["*.toml", "*.sql", "*.yaml"]
"testgen.template" = ["*.sql", "*.yaml", "**/*.sql", "**/*.yaml"]
"testgen.ui.assets" = ["*.svg", "*.png", "*.js", "*.css"]
"testgen.ui.assets" = ["*.svg", "*.png", "*.js", "*.css", "*.ico", "flavors/*.svg"]
"testgen.ui.components.frontend" = ["*.html", "**/*.js", "**/*.css", "**/*.woff2", "**/*.svg"]

[tool.setuptools.packages.find]
Expand Down Expand Up @@ -224,8 +227,9 @@ select = ["A", "F", "S", "I", "T10", "B", "UP", "ISC", "T20", "RSE", "Q", "ARG",
# globally ignore the following error codes
# * TRY003: Avoid specifying long messages outside the exception class
# * S608: Hardcoded SQL
# # F841: Unused local variable (it is instable)
ignore = ["TRY003", "S608", "S404", "F841"]
# * F841: Unused local variable (it is instable)
# * B023: Buggy: https://github.com/astral-sh/ruff/issues/7847
ignore = ["TRY003", "S608", "S404", "F841", "B023"]

# Ignore the following errors in files:
# F403 - in __init__.py: We use __all__ in our module files so this behavior is acceptable in __init__.py
Expand All @@ -237,6 +241,7 @@ ignore = ["TRY003", "S608", "S404", "F841"]
"tests*" = ["S101", "T201"]
"invocations/**" = ["ARG001", "T201"]
"testgen/common/encrypt.py" = ["S413"]
"testgen/ui/pdf/dk_logo.py" = ["T201"]

# See: https://coverage.readthedocs.io/en/latest/config.html
[tool.coverage.run]
Expand Down
80 changes: 0 additions & 80 deletions testgen/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import getpass
import logging
import os
import subprocess
Expand Down Expand Up @@ -33,7 +32,6 @@
from testgen.commands.run_observability_exporter import run_observability_exporter
from testgen.commands.run_profiling_bridge import run_profiling_queries
from testgen.commands.run_quick_start import run_quick_start, run_quick_start_increment
from testgen.commands.run_setup_profiling_tools import run_setup_profiling_tools
from testgen.commands.run_upgrade_db_config import get_schema_revision, is_db_revision_up_to_date, run_upgrade_db_config
from testgen.common import (
configure_logging,
Expand Down Expand Up @@ -450,84 +448,6 @@ def do_upgrade_system_version():
click.echo("System and services upgrade is not required.")


@cli.command(
"setup-target-db-functions", help="Use to set up the utility functions in the target database for running profiles."
)
@click.option(
"-c",
"--connection-id",
help="The identifier for the connection. Use a connection_id shown in list-connections.",
required=True,
type=click.STRING,
)
@click.option(
"-dr",
"--dry-run",
default=False,
is_flag=True,
required=False,
help="Dry run to show which schema will be modified",
)
@click.option(
"-cs",
"--create-qc-schema",
default=False,
is_flag=True,
required=False,
help="Create the QC utility schema required in the target database",
)
@click.option("--yes", "-y", default=False, is_flag=True, required=False, help="Force yes")
@click.option(
"--skip-asking-credentials",
"-s",
default=False,
is_flag=True,
required=False,
help="Skip request for special write credentials for target database, uses standard credentials instead",
)
@click.option(
"--skip-granting-privileges",
"-sgp",
default=False,
is_flag=True,
required=False,
help="Skip granting execute privileges to the user for the QC utility schema in the target database",
)
@pass_configuration
def setup_profiling_tools(
configuration: Configuration,
connection_id: str,
dry_run: bool,
create_qc_schema: bool,
yes: bool,
skip_asking_credentials: bool,
skip_granting_privileges: bool,
):
db_user = None
db_password = None
if not skip_asking_credentials:
db_user = input("Admin DB User?")
db_password = getpass.getpass("Admin DB Password?")

if not yes and not dry_run:
confirm = input(
f"Are you sure you want to setup the utility functions to be able to run the profile for connection {connection_id}? [yes/No]"
)
if confirm.lower() != "yes":
click.echo("Exiting without any operation performed.")
return
project_qc_schema = run_setup_profiling_tools(
connection_id, dry_run, create_qc_schema, db_user, db_password, skip_granting_privileges
)
if not dry_run:
message = f"Project DB has been set up. Modified schema: {project_qc_schema}"
else:
message = (
f"Project DB dry run completed, no changes applied. Modified schema would have been: {project_qc_schema}"
)
click.echo(message)


@cli.command("get-test-results", help="Fetches results for a test run.")
@click.option(
"-tr",
Expand Down
20 changes: 16 additions & 4 deletions testgen/commands/queries/execute_cat_tests_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from testgen.common import date_service, read_template_sql_file
from testgen.common.database import database_service
from testgen.common.read_file import replace_templated_functions


class CCATExecutionSQL:
Expand All @@ -11,13 +12,13 @@ class CCATExecutionSQL:
test_suite = ""
run_date = ""
test_run_id = ""
table_groups_id = ""
max_query_chars = ""
exception_message = ""

# Test Set Parameters
target_schema = ""
target_table = ""
replace_qc_schema = ""
dctTestParms: typing.ClassVar = {}

def __init__(self, strProjectCode, strTestSuiteId, strTestSuite, strSQLFlavor, max_query_chars, minutes_offset=0):
Expand All @@ -38,9 +39,8 @@ def _ReplaceParms(self, strInputString):
strInputString = strInputString.replace("{PROJECT_CODE}", self.project_code)
strInputString = strInputString.replace("{TEST_SUITE}", self.test_suite)
strInputString = strInputString.replace("{TEST_SUITE_ID}", self.test_suite_id)
# NOTE: REPLACE_QC_SCHEMA is parm replaced to run build query: sets the actual value to replace.
# DATA_QC_SCHEMA is parm in cat_test_conditions that build query replaces via SQL.
strInputString = strInputString.replace("{REPLACE_QC_SCHEMA}", self.replace_qc_schema)
strInputString = strInputString.replace("{TABLE_GROUPS_ID}", self.table_groups_id)

strInputString = strInputString.replace("{SQL_FLAVOR}", self.flavor)
strInputString = strInputString.replace("{CONCAT_OPERATOR}", self.concat_operator)

Expand All @@ -60,6 +60,9 @@ def _ReplaceParms(self, strInputString):

strInputString = strInputString.replace("{RUN_DATE}", self.run_date)

if "{{DKFN_" in strInputString:
strInputString = replace_templated_functions(strInputString, self.flavor)

# Adding escape character where ':' is referenced
strInputString = strInputString.replace(":", "\\:")

Expand Down Expand Up @@ -95,3 +98,12 @@ def FinalizeTestResultsSQL(self):
def PushTestRunStatusUpdateSQL(self):
strQ = self._ReplaceParms(read_template_sql_file("ex_update_test_record_in_testrun_table.sql", "execution"))
return strQ

def FinalizeTestSuiteUpdateSQL(self):
strQ = self._ReplaceParms(read_template_sql_file("ex_update_test_suite.sql", "execution"))
return strQ


def TestScoringRollupSQL(self):
strQ = self._ReplaceParms(read_template_sql_file("test_scoring_rollup.sql", "execution"))
return strQ
32 changes: 19 additions & 13 deletions testgen/commands/queries/profiling_query.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import typing

from testgen.common import date_service, read_template_sql_file, read_template_yaml_file
from testgen.common.read_file import replace_templated_functions


class CProfilingSQL:
Expand All @@ -13,7 +14,6 @@ class CProfilingSQL:
table_groups_id = ""
flavor = ""
run_date = ""
data_qc_schema = ""
data_schema = ""
data_table = ""

Expand Down Expand Up @@ -74,7 +74,6 @@ def ReplaceParms(self, strInputString):
strInputString = strInputString.replace("{TABLE_GROUPS_ID}", self.table_groups_id)
strInputString = strInputString.replace("{RUN_DATE}", self.run_date)
strInputString = strInputString.replace("{DATA_SCHEMA}", self.data_schema)
strInputString = strInputString.replace("{DATA_QC_SCHEMA}", self.data_qc_schema)
strInputString = strInputString.replace("{DATA_TABLE}", self.data_table)
strInputString = strInputString.replace("{COL_NAME}", self.col_name)
strInputString = strInputString.replace("{COL_NAME_SANITIZED}", self.col_name.replace("'", "''"))
Expand All @@ -98,6 +97,8 @@ def ReplaceParms(self, strInputString):
strInputString = strInputString.replace("{CONTINGENCY_COLUMNS}", self.contingency_columns)
strInputString = strInputString.replace("{CONTINGENCY_MAX_VALUES}", self.contingency_max_values)
strInputString = strInputString.replace("{PROCESS_ID}", str(self.process_id))
if "{{DKFN_" in strInputString:
strInputString = replace_templated_functions(strInputString, self.flavor)

return strInputString

Expand Down Expand Up @@ -141,11 +142,16 @@ def GetPIIFlagUpdateQuery(self):
strQ = self.ReplaceParms(read_template_sql_file("pii_flag.sql", sub_directory="profiling"))
return strQ

def GetAnomalyRefreshQuery(self):
def GetAnomalyStatsRefreshQuery(self):
# Runs on DK Postgres Server
strQ = self.ReplaceParms(read_template_sql_file("refresh_anomalies.sql", sub_directory="profiling"))
return strQ

def GetAnomalyScoringRollupQuery(self):
# Runs on DK Postgres Server
strQ = self.ReplaceParms(read_template_sql_file("profile_anomaly_scoring_rollup.sql", sub_directory="profiling"))
return strQ

def GetAnomalyTestTypesQuery(self):
# Runs on DK Postgres Server
strQ = self.ReplaceParms(read_template_sql_file("profile_anomaly_types_get.sql", sub_directory="profiling"))
Expand Down Expand Up @@ -175,6 +181,16 @@ def GetAnomalyTestQuery(self, dct_test_type):

return strQ

def GetAnomalyScoringQuery(self, dct_test_type):
# Runs on DK Postgres Server
strQ = read_template_sql_file("profile_anomaly_scoring.sql", sub_directory="profiling")
if strQ:
strQ = strQ.replace("{PROFILE_RUN_ID}", self.profile_run_id)
strQ = strQ.replace("{ANOMALY_ID}", dct_test_type["id"])
strQ = strQ.replace("{PREV_FORMULA}", dct_test_type["dq_score_prevalence_formula"])
strQ = strQ.replace("{RISK}", dct_test_type["dq_score_risk_factor"])
return strQ

def GetDataCharsRefreshQuery(self):
# Runs on DK Postgres Server
strQ = self.ReplaceParms(
Expand Down Expand Up @@ -227,16 +243,6 @@ def _get_mask_query(self, mask, is_include):
sub_query += ")"
return sub_query

def GetFunctionCreatorQuery(self):
# Runs on Project DB
strQ = self.ReplaceParms(
read_template_sql_file(
f"project_function_creator_{self.flavor}.sql",
sub_directory=f"flavors/{self.flavor}/setup_profiling_tools",
)
)
return strQ

def GetProfilingQuery(self):
# Runs on Project DB
if not self.dctSnippetTemplate:
Expand Down
7 changes: 5 additions & 2 deletions testgen/commands/run_execute_cat_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ def ParseCATResults(clsCATExecute):


def FinalizeTestRun(clsCATExecute):
lstQueries = [clsCATExecute.FinalizeTestResultsSQL(), clsCATExecute.PushTestRunStatusUpdateSQL()]
lstQueries = [clsCATExecute.FinalizeTestResultsSQL(),
clsCATExecute.PushTestRunStatusUpdateSQL(),
clsCATExecute.FinalizeTestSuiteUpdateSQL(),
clsCATExecute.TestScoringRollupSQL()]
RunActionQueryList(("DKTG"), lstQueries)


Expand All @@ -80,6 +83,7 @@ def run_cat_test_queries(
)
clsCATExecute.test_run_id = strTestRunID
clsCATExecute.run_date = strTestTime
clsCATExecute.table_groups_id = dctParms["table_groups_id"]
clsCATExecute.exception_message += error_msg

# Set Project Connection Params in common.db_bridgers from retrieved params
Expand Down Expand Up @@ -119,7 +123,6 @@ def run_cat_test_queries(
for dctTable in lstTables:
clsCATExecute.target_schema = dctTable["schema_name"]
clsCATExecute.target_table = dctTable["table_name"]
clsCATExecute.replace_qc_schema = dctTable["replace_qc_schema"]
AggregateTableTests(clsCATExecute)

LOG.info("CurrentStep: Retrieving CAT Tests to Run")
Expand Down
1 change: 0 additions & 1 deletion testgen/commands/run_launch_db_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ def _get_params_mapping() -> dict:
"PROFILING_SAMPLE_MIN_COUNT": "",
"PROFILING_DELAY_DAYS": "",
"CONNECTION_NAME": settings.PROJECT_CONNECTION_NAME,
"PROJECT_QC_SCHEMA": settings.PROJECT_QC_SCHEMA,
"TABLE_GROUPS_NAME": settings.DEFAULT_TABLE_GROUPS_NAME,
"TEST_SUITE": settings.DEFAULT_TEST_SUITE_KEY,
"TEST_SUITE_DESCRIPTION": settings.DEFAULT_TEST_SUITE_DESCRIPTION,
Expand Down
Loading
Loading