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

Add roles to tags and classification #18245

Draft
wants to merge 105 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
dfea5ae
Add roles to tags and classification
harshach Oct 11, 2024
f7b3584
Update docs sync workflow to push content to main branch (#18160)
aniketkatkar97 Oct 8, 2024
244b548
MINOR: added check to append reserve-sidebar class to body (#18141)
Ashish8689 Oct 8, 2024
1be3044
MINOR - Add support for additional aggregation (#18129)
TeddyCr Oct 8, 2024
3fe0bf9
Refactor ServiceConnectionDetails component to handle specific Airflo…
ayush-shah Oct 8, 2024
75771d9
Remove the collate connector links from the OSS menu.md (#18159)
aniketkatkar97 Oct 8, 2024
184e37c
GEN-1322: API Entity - Remove Beta (#17967)
Sachin-chaurasiya Oct 8, 2024
227aee6
Minor: Updated pyiceberg version to 0.5.1 (#18155)
Prajwal214 Oct 8, 2024
0a368dd
Image Updates for Quick Start docs (#18113)
RounakDhillon Oct 8, 2024
ffc25a7
Gen-882: Add max length validation for glossary term rename (#18166)
karanh37 Oct 8, 2024
0261caf
fix: Glue Pipeline Yaml fixed (#18163)
ayush-shah Oct 9, 2024
19152f9
MINOR: open links in new tab in DataAssetsHeader (#18172)
fuzmish Oct 9, 2024
df87a5b
FIX - App Extension Migration (#18176)
pmbrull Oct 9, 2024
fbf065f
Order Apps (#18179)
mohityadav766 Oct 9, 2024
f5989d5
chore(ui): move persona as top level settings (#18171)
chirag-madlani Oct 9, 2024
829efe1
doc: Update GCS connector platform in storage connectors list (#18164)
ayush-shah Oct 9, 2024
070adba
Fix #18177: Fix Hive Metastore connection issue (#18178)
ulixius9 Oct 9, 2024
4a515ac
Fix Redshift profiler for external tables in Redshift Spectrum (#18182)
devanshGarg-lumiq Oct 9, 2024
8599d3a
PLAYWRIGHT: fix activityFeed and DataInsight AUT playwright test (#18…
Ashish8689 Oct 9, 2024
7f43b12
Docs: Data Quality link correction (#18183)
RounakDhillon Oct 9, 2024
87fafb2
Docs: Suite link correction (#18189)
RounakDhillon Oct 9, 2024
55d719f
Fix the automator page breaking when no source is selected (#18190)
aniketkatkar97 Oct 9, 2024
f4a6eee
MINOR: Update DB2 dependencies to fix issue about not having ibm-db i…
IceS2 Oct 9, 2024
081ad61
Docs: Adding Automation Section (#18161)
RounakDhillon Oct 9, 2024
760d5b3
Docs: Updating Collate Menu (#18200)
RounakDhillon Oct 10, 2024
20cc01f
GEN-970: Refactor redshift system metrics to support freshness test (…
sushi30 Oct 10, 2024
1626794
GEN-1727: Pluralize owner label everywhere (#18117)
Sachin-chaurasiya Oct 10, 2024
158a0ad
Docs: Fixing Automation Docs (#18202)
Prajwal214 Oct 10, 2024
700b852
Docs: updating getting started Docs (#18204)
Prajwal214 Oct 10, 2024
af3b977
Docs: Fixing Automation Docs (#18206)
Prajwal214 Oct 10, 2024
4ca78fc
Docs: Updating getting started Docs (#18207)
Prajwal214 Oct 10, 2024
da43af5
fix: broken DQ alerts from PR #18014 (#18181)
TeddyCr Oct 10, 2024
53ca63a
Docs: Fixing Automation Docs (#18212)
Prajwal214 Oct 10, 2024
a6f05b5
remove unwanted items in menu.md (#18214)
aniketkatkar97 Oct 10, 2024
3ad3fd8
Docs: Removing Broken Menu Links (#18217)
Prajwal214 Oct 10, 2024
116d441
fix(ui): compare version only if version is set (#18210)
chirag-madlani Oct 10, 2024
51845a9
fix(ui): pagination with search on service page (#18211)
chirag-madlani Oct 10, 2024
7879ca5
[OnBoardingApp] Add apps data store (#18209)
mohityadav766 Oct 10, 2024
dbb4036
FIX - App Extension migration JSONB (#18219)
pmbrull Oct 10, 2024
d16cf9f
TEST - Add ES pagination with multiple filters (#18162)
pmbrull Oct 10, 2024
9f9f655
fix(data-quality): table diff url (#18221)
sushi30 Oct 10, 2024
006d3bc
migrate serviceType (#18226)
Siddhanttimeline Oct 10, 2024
4e153b7
Feature : Add table-type custom property (#18135)
sonika-shah Oct 10, 2024
74cedf4
MINOR: add data quality tests (#18193)
sushi30 Oct 11, 2024
0561536
GEN 1654 - Fix Alerts for Test Suites (#18222)
TeddyCr Oct 11, 2024
bc0b5ae
GEN-1793: fix app config from resource (#18228)
sushi30 Oct 11, 2024
7208744
Fixed mysql E2E (#18229)
SumanMaharana Oct 11, 2024
bfe9ad4
Migrations fixes for #17967 (#18232)
Siddhanttimeline Oct 11, 2024
87434c8
MINOR: fix dark border shown in navbar (#18230)
Ashish8689 Oct 11, 2024
3cdfad9
MINOR: fix(looker): exclude version
sushi30 Oct 11, 2024
b43a2f5
Minor: Add deleteEntityByFQNPrefix (#18243)
harshach Oct 13, 2024
91db2fd
Docs: Adding Metapilot Section (#18213)
RounakDhillon Oct 14, 2024
3c5d07f
fix: youtube link fix (#18249)
ayush-shah Oct 14, 2024
c088811
Fixed dbt Manifest and Run results parsing (#18234)
SumanMaharana Oct 14, 2024
ebdc7a4
GEN-895: Added Glue Pipeline Lineage (#18063)
SumanMaharana Oct 14, 2024
ae14c8d
MINOR - Improve exception messages for JWT Filter (#18231)
pmbrull Oct 14, 2024
bc397bd
docs(restore): database restore clarifications (#18253)
sushi30 Oct 14, 2024
914d0f1
Add array supp for json schema parser (#18255)
OnkarVO7 Oct 15, 2024
f477f6a
Fix #17963: Fix PinotDB Ingestion (#18266)
ulixius9 Oct 15, 2024
f5802e1
GEN-1836: Table custom property enhancements (#18239)
sonika-shah Oct 15, 2024
9326f54
fix query for mysql con. (#18272)
harshsoni2024 Oct 15, 2024
1cd69da
minor(ci): enable sonar CI on release branch (#18275)
chirag-madlani Oct 15, 2024
aa01984
MINOR: added loader in activity feed open and closed count (#18274)
Ashish8689 Oct 15, 2024
e387990
fixed dbt tag name (#18273)
OnkarVO7 Oct 15, 2024
9f44172
MINOR: add column case sensitivity parameter (#18115)
sushi30 Oct 15, 2024
2259d02
fix: add domain params for test suite search list filter (#18263)
TeddyCr Oct 15, 2024
eed4b86
Minor : Fix exception in search due to exception in database.display…
sonika-shah Oct 16, 2024
3dbaad1
Fixes #18186: Quicksight Ingestion Error handled (#18218)
ayush-shah Oct 16, 2024
72c4c6e
MINOR: Fix Couchbase columns not fetched (#18284)
ulixius9 Oct 16, 2024
db4ca1d
GEN-1662 : Fix - on dashboard soft delete, chart should not be visibl…
sonika-shah Oct 16, 2024
fb4c330
MINOR: Fix pinotdb col. datatype error (#18268)
harshsoni2024 Oct 16, 2024
43eed5b
salesforce table description from label if not through query (#18286)
harshsoni2024 Oct 16, 2024
47995e1
chore(data-diff): added migrations (#18287)
sushi30 Oct 16, 2024
2a0256e
MINOR: add supportsDataDiff flag (#18205)
sushi30 Oct 16, 2024
9c09e47
test: custom properties AUT (#18288)
Sachin-chaurasiya Oct 16, 2024
b717e19
feat: add Import/export support for table type custom property in glo…
sonika-shah Oct 16, 2024
7148dba
fix: GEN-1856 encode and escape search value for the tag search (#18285)
chirag-madlani Oct 16, 2024
d1fd590
minor: improve csv parsing for custom properties (#18293)
Sachin-chaurasiya Oct 16, 2024
61281d8
Chore(deps): Bump markdown-to-jsx (#18282)
dependabot[bot] Oct 16, 2024
5cce373
Minor: Add an option to execute data migrations in ext migrations (#1…
harshach Oct 16, 2024
8f2b706
MINOR - Pass timeout to test connection and return TestConnectionStep…
pmbrull Oct 16, 2024
2674e84
GEN-1166 - Improve Ingestion Workflow Error Summary (#18280)
pmbrull Oct 16, 2024
901b6a9
correct negative values of the changeCount. (#18279)
Siddhanttimeline Oct 16, 2024
67e8724
Minor : increase MAX_AGGREGATE_SIZE in search (#18299)
sonika-shah Oct 16, 2024
4a6af36
Minor : remove EnumWithDescriptions in basic.json (#18305)
sonika-shah Oct 17, 2024
6318bb5
FIX #17042 - Allow non admin/bot to read profiler global config (#18292)
TeddyCr Oct 17, 2024
6be79f7
fix: remove test case result index from all index (#18295)
TeddyCr Oct 17, 2024
81cfd2b
Added Alation Conn side panel docs (#18297)
OnkarVO7 Oct 17, 2024
d5190a2
MINOR - added test case results to search reindex (#18277)
TeddyCr Oct 17, 2024
e4b66a2
Docs: Glue Spark Pipeline Lineage (#18311)
ulixius9 Oct 17, 2024
1c744d1
MINOR: added testSuite field back to lineage response (#18313)
TeddyCr Oct 17, 2024
965fb2d
What's new in 1.5.7 (#18312)
harshsoni2024 Oct 17, 2024
600d7cd
Add Query builder widget (#18314)
karanh37 Oct 17, 2024
2bfdbe6
FIX #18309: fixed task deserialization in Airflow metadata ingestion …
trina242 Oct 17, 2024
fb2654d
feat: update version (#18259)
kuma0128 Oct 17, 2024
aeacfeb
Minor: Fix rbac for multiple rules (#18057)
harshach Oct 18, 2024
6d182bb
fix(ui): GEN-1690 refresh before expiry of access token (#18235)
chirag-madlani Oct 18, 2024
5d90999
fixed dashboardDataModel enum in spec (#18304)
trina242 Oct 18, 2024
2f2df40
MINOR - Validate app runner init (#18316)
pmbrull Oct 18, 2024
e30a895
MINOR - Return TestConnectionResult from test_connection_fn (#18320)
pmbrull Oct 18, 2024
98c04e2
MINOR - live index on test suite creation (#18317)
TeddyCr Oct 18, 2024
4ec92aa
Fix Search RBAC, avoid processing Operations other than ViewAll, View…
harshach Oct 19, 2024
5f0b1c0
Minor: Add an API to list all the properties and custom properties f…
harshach Oct 19, 2024
fff3eea
Fix #18007: Disabled Classifications or Tags shouldn't be visible in …
harshach Oct 19, 2024
d15558b
Add Tag/Classification Roles
harshach Oct 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/maven-sonar-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
push:
branches:
- main
- '0.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+'
paths:
- "openmetadata-service/**"
- "openmetadata-ui/**"
Expand Down Expand Up @@ -116,4 +116,4 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
fail_on_test_failures: true
report_paths: 'openmetadata-service/target/surefire-reports/TEST-*.xml'
report_paths: 'openmetadata-service/target/surefire-reports/TEST-*.xml'
4 changes: 2 additions & 2 deletions .github/workflows/sync-docs-v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
destination-repository-name: 'docs-v1'
user-email: [email protected]
commit-message: See ORIGIN_COMMIT from $GITHUB_REF
target-branch: publish
target-branch: main

- name: Push images
id: push_images
Expand All @@ -54,7 +54,7 @@ jobs:
destination-repository-name: 'docs-v1'
user-email: [email protected]
commit-message: See ORIGIN_COMMIT from $GITHUB_REF
target-branch: publish
target-branch: main

- name: Prepare Collate content and partials
id: prepare_collate
Expand Down
2 changes: 1 addition & 1 deletion .run/Template JUnit.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -DjdbcContainerClassName=org.testcontainers.containers.MySQLContainer -DjdbcContainerImage=mysql:8 -DelasticSearchContainerClassName=docker.elastic.co/elasticsearch/elasticsearch:8.10.2 -DopenSearchContainerClassName=opensearchproject/opensearch:1.3.0 -DrunESTestCases=false"/>
<option name="VM_PARAMETERS" value="-ea -DjdbcContainerClassName=org.testcontainers.containers.MySQLContainer -DjdbcContainerImage=mysql:8 -DelasticSearchContainerClassName=docker.elastic.co/elasticsearch/elasticsearch:8.11.4 -DopenSearchContainerClassName=opensearchproject/opensearch:1.3.0 -DrunESTestCases=false"/>
<method v="2">
<option name="Make" enabled="true" />
</method>
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ currently being supported with security updates.

| Version | Supported |
| ------- | ------------------ |
| 1.5.x | :white_check_mark: |
| 1.4.x | :white_check_mark: |
| 1.3.x | :white_check_mark: |

## Reporting a Vulnerability

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
UPDATE test_definition
SET json = JSON_MERGE_PRESERVE(
json,
JSON_OBJECT(
'parameterDefinition',
JSON_ARRAY(
JSON_OBJECT(
'name', 'caseSensitiveColumns',
'dataType', 'BOOLEAN',
'required', false,
'description', 'Use case sensitivity when comparing the columns.',
'displayName', 'Case sensitive columns'
)
)
)
)
WHERE name = 'tableDiff';
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
UPDATE test_definition
SET json = jsonb_set(
json,
'{parameterDefinition}',
(json->'parameterDefinition')::jsonb ||
'{"name": "caseSensitiveColumns", "dataType": "BOOLEAN", "required": false, "description": "Use case sensitivity when comparing the columns.", "displayName": "Case sensitive columns"}'::jsonb
)
WHERE name = 'tableDiff';
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,8 @@ UPDATE installed_apps SET json = JSON_SET(json, '$.supportsInterrupt', true) whe
UPDATE apps_marketplace SET json = JSON_SET(json, '$.supportsInterrupt', true) where name = 'SearchIndexingApplication';

ALTER TABLE apps_extension_time_series ADD COLUMN appName VARCHAR(256) GENERATED ALWAYS AS (json ->> '$.appName') STORED NOT NULL;

-- Add supportsDataDiff for Athena, BigQuery, Mssql, Mysql, Oracle, Postgres, Redshift, SapHana, Snowflake, Trino
UPDATE dbservice_entity
SET json = JSON_SET(json, '$.connection.config.supportsDataDiff', 'true')
WHERE serviceType IN ('Athena','BigQuery','Mssql','Mysql','Oracle','Postgres','Redshift','SapHana','Snowflake','Trino');
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,11 @@ ALTER TABLE apps_extension_time_series MODIFY COLUMN extension VARCHAR(255) NOT
CREATE INDEX apps_extension_time_series_extension ON apps_extension_time_series(extension);

-- Clean dangling workflows not removed after test connection
truncate automations_workflow;
truncate automations_workflow;

-- App Data Store
CREATE TABLE IF NOT EXISTS apps_data_store (
identifier VARCHAR(256) NOT NULL,
type VARCHAR(256) NOT NULL,
json JSON NOT NULL
);
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,8 @@ SET json = jsonb_set(
where name = 'SearchIndexingApplication';

ALTER TABLE apps_extension_time_series ADD COLUMN appName VARCHAR(256) GENERATED ALWAYS AS (json ->> 'appName') STORED NOT NULL;

-- Add supportsDataDiff for Athena, BigQuery, Mssql, Mysql, Oracle, Postgres, Redshift, SapHana, Snowflake, Trino
UPDATE dbservice_entity
SET json = jsonb_set(json::jsonb, '{connection,config,supportsDataDiff}', 'true'::jsonb)
WHERE serviceType IN ('Athena','BigQuery','Mssql','Mysql','Oracle','Postgres','Redshift','SapHana','Snowflake','Trino');
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,11 @@ ALTER TABLE apps_extension_time_series ALTER COLUMN extension SET NOT NULL;
CREATE INDEX IF NOT EXISTS apps_extension_time_series_extension ON apps_extension_time_series(extension);

-- Clean dangling workflows not removed after test connection
truncate automations_workflow;
truncate automations_workflow;

-- App Data Store
CREATE TABLE IF NOT EXISTS apps_data_store (
identifier VARCHAR(256) NOT NULL,
type VARCHAR(256) NOT NULL,
json JSON NOT NULL
);
2 changes: 1 addition & 1 deletion docker/development/docker-compose-gcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ services:
- ./docker-volume/db-data:/var/lib/mysql

elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.10.2
image: docker.elastic.co/elasticsearch/elasticsearch:8.11.4
container_name: openmetadata_elasticsearch
environment:
- discovery.type=single-node
Expand Down
2 changes: 1 addition & 1 deletion docker/development/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ services:
- ./docker-volume/db-data:/var/lib/mysql

elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.10.2
image: docker.elastic.co/elasticsearch/elasticsearch:8.11.4
container_name: openmetadata_elasticsearch
environment:
- discovery.type=single-node
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ services:

elasticsearch:
container_name: openmetadata_elasticsearch
image: docker.elastic.co/elasticsearch/elasticsearch:8.10.2
image: docker.elastic.co/elasticsearch/elasticsearch:8.11.4
environment:
- discovery.type=single-node
- ES_JAVA_OPTS=-Xms1024m -Xmx1024m
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose-quickstart/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ services:

elasticsearch:
container_name: openmetadata_elasticsearch
image: docker.elastic.co/elasticsearch/elasticsearch:8.10.2
image: docker.elastic.co/elasticsearch/elasticsearch:8.11.4
environment:
- discovery.type=single-node
- ES_JAVA_OPTS=-Xms1024m -Xmx1024m
Expand Down
4 changes: 2 additions & 2 deletions docker/run_local_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ echo "Running local docker using mode [$mode] database [$database] and skipping
cd ../

echo "Stopping any previous Local Docker Containers"
docker compose -f docker/development/docker-compose-postgres.yml down
docker compose -f docker/development/docker-compose.yml down
docker compose -f docker/development/docker-compose-postgres.yml down --remove-orphans
docker compose -f docker/development/docker-compose.yml down --remove-orphans

if [[ $skipMaven == "false" ]]; then
if [[ $mode == "no-ui" ]]; then
Expand Down
4 changes: 2 additions & 2 deletions ingestion/examples/sample_data/api_service/service.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"type": "REST",
"type": "rest",
"serviceName": "sample_api_service",
"serviceConnection": {
"config": {
"type": "REST",
"type": "Rest",
"openAPISchemaURL": "https://petstore3.swagger.io/",
"token":"mock_token"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"type": "REST",
"type": "rest",
"serviceName": "ometa_api_service",
"serviceConnection": {
"config": {
"type": "REST",
"type": "Rest",
"openAPISchemaURL": "https://docs.open-metadata.org/swagger.html",
"token":"token"
}
Expand Down
3 changes: 3 additions & 0 deletions ingestion/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')"
]

[project.entry-points.pytest11]
pytest_openmetadata = "_openmetadata_testutils.pytest_openmetadata.plugin"

[tool.pylint.BASIC]
# W1203: logging-fstring-interpolation - f-string brings better readability and unifies style
# W1202: logging-format-interpolation - lazy formatting in logging functions
Expand Down
6 changes: 3 additions & 3 deletions ingestion/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"databricks-sdk": "databricks-sdk>=0.18.0,<0.20.0",
"trino": "trino[sqlalchemy]",
"spacy": "spacy<3.8",
"looker-sdk": "looker-sdk>=22.20.0",
"looker-sdk": "looker-sdk>=22.20.0,!=24.18.0",
"lkml": "lkml~=1.3",
"tableau": "tableau-api-lib~=0.1",
"pyhive": "pyhive[hive_pure_sasl]~=0.7",
Expand Down Expand Up @@ -183,7 +183,7 @@
VERSIONS["azure-storage-blob"],
VERSIONS["azure-identity"],
},
"db2": {"ibm-db-sa~=0.3"},
"db2": {"ibm-db-sa~=0.4.1", "ibm-db>=2.0.0"},
"db2-ibmi": {"sqlalchemy-ibmi~=0.9.3"},
"databricks": {
VERSIONS["sqlalchemy-databricks"],
Expand Down Expand Up @@ -236,7 +236,7 @@
"impyla~=0.18.0",
},
"iceberg": {
"pyiceberg>=0.5",
"pyiceberg==0.5.1",
# Forcing the version of a few packages so it plays nicely with other requirements.
VERSIONS["pydantic"],
VERSIONS["adlfs"],
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
from typing import Type

import pytest

from _openmetadata_testutils.ometa import int_admin_ometa
from metadata.generated.schema.entity.teams.user import AuthenticationMechanism, User
from metadata.generated.schema.metadataIngestion.workflow import LogLevels
from metadata.ingestion.api.common import Entity
from metadata.ingestion.ometa.ometa_api import OpenMetadata
from metadata.workflow.ingestion import IngestionWorkflow


@pytest.fixture(scope="session")
def metadata():
return int_admin_ometa()


@pytest.fixture(scope="session")
def sink_config(metadata):
return {
"type": "metadata-rest",
"config": {},
}


@pytest.fixture(scope="session")
def workflow_config(metadata):
return {
"loggerLevel": LogLevels.DEBUG.value,
"openMetadataServerConfig": metadata.config.model_dump(),
}


@pytest.fixture(scope="session")
def ingestion_bot_wokflow_config(metadata, workflow_config):
ingestion_bot: User = metadata.get_by_name(
entity=User, fqn="ingestion-bot", nullable=False
)
ingestion_bot_auth: AuthenticationMechanism = metadata.get_by_id(
entity=AuthenticationMechanism, entity_id=ingestion_bot.id, nullable=False
)
workflow_config = workflow_config.copy()
workflow_config["openMetadataServerConfig"]["securityConfig"][
"jwtToken"
] = ingestion_bot_auth.config.JWTToken
return workflow_config


@pytest.fixture()
def clean_up_fqn(metadata):
fqns = []

def inner(entity_type: type[Entity], fqn: str):
fqns.append((entity_type, fqn))

yield inner
for entity_type, fqn in fqns:
entity = metadata.get_by_name(entity_type, fqn, fields=["*"])
if entity:
metadata.delete(entity_type, entity.id, recursive=True, hard_delete=True)


@pytest.fixture(scope="session")
def ingestion_bot_workflow_config(metadata: OpenMetadata):
ingestion_bot: User = metadata.get_by_name(entity=User, fqn="ingestion-bot")
ingestion_bot_auth: AuthenticationMechanism = metadata.get_by_id(
entity=AuthenticationMechanism, entity_id=ingestion_bot.id
)
config = metadata.config.model_dump()
config["securityConfig"]["jwtToken"] = ingestion_bot_auth.config.JWTToken
return {
"loggerLevel": LogLevels.DEBUG.value,
"openMetadataServerConfig": config,
}


@pytest.fixture(scope="module")
def run_workflow():
def _run(workflow_type: Type[IngestionWorkflow], config, raise_from_status=True):
workflow: IngestionWorkflow = workflow_type.create(config)
workflow.execute()
if raise_from_status:
workflow.raise_from_status()
return workflow

return _run
Loading
Loading