Skip to content

Commit 5b510e8

Browse files
Merge branch 'main' into fix-logout-twice
2 parents 3f66837 + c679793 commit 5b510e8

180 files changed

Lines changed: 18719 additions & 1293 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/copilot-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ make unit_ingestion_dev_env # For Python changes
566566

567567
## UI Pull Request Review Guidelines
568568

569-
**IMPORTANT: When reviewing UI pull requests, you MUST follow the comprehensive guidelines in [/openmetadata-ui/UI_PR_REVIEW_GUIDELINES.md](../openmetadata-ui/UI_PR_REVIEW_GUIDELINES.md)**
569+
**IMPORTANT: When reviewing UI pull requests, you MUST follow the comprehensive guidelines in [/openmetadata-ui/UI_PR_REVIEW_GUIDELINES.md](../openmetadata-ui/UI_PR_REVIEW_GUIDELINES.md) and [/openmetadata-ui/src/main/resources/ui/playwright/PLAYWRIGHT_DEVELOPER_HANDBOOK.md](../openmetadata-ui/src/main/resources/ui/playwright/PLAYWRIGHT_DEVELOPER_HANDBOOK.md)**
570570

571571
### Critical UI Standards to Enforce
572572

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- DO NOT RENAME OR DELETE THIS FILE
2+
-- Migrations are applied from Java code based on the version in the file name inside folder openmetadata-service/src/main/java/org/openmetadata/service/migration/mysql/v1114
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- DO NOT RENAME OR DELETE THIS FILE
2+
-- Migrations are applied from Java code based on the version in the file name inside folder openmetadata-service/src/main/java/org/openmetadata/service/migration/postgres/v1114

conf/openmetadata.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ authenticationConfiguration:
291291
jwtPrincipalClaims: ${AUTHENTICATION_JWT_PRINCIPAL_CLAIMS:-[email,preferred_username,sub]}
292292
jwtPrincipalClaimsMapping: ${AUTHENTICATION_JWT_PRINCIPAL_CLAIMS_MAPPING:-[]}
293293
enableSelfSignup : ${AUTHENTICATION_ENABLE_SELF_SIGNUP:-true}
294+
enableAutoRedirect: ${AUTHENTICATION_ENABLE_AUTO_REDIRECT:-false}
294295
# Force secure flag on session cookies even when not using HTTPS directly.
295296
# Enable this when running behind a proxy/load balancer that handles SSL termination.
296297
# Default: false (secure flag only set when HTTPS is detected)

ingestion/src/metadata/ingestion/models/custom_pydantic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def model_dump(
140140
*,
141141
mask_secrets: bool = False,
142142
warnings: Union[bool, Literal["none", "warn", "error"]] = "none",
143-
**kwargs,
143+
**kwargs: Any,
144144
) -> Dict[str, Any]:
145145
if mask_secrets:
146146
context = kwargs.pop("context", None) or {}

ingestion/src/metadata/ingestion/ometa/mixins/domain_mixin.py

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,91 @@ def _handle_data_product_assets(
126126
payload = AssetsRequest(assets=assets)
127127

128128
return self.client.put(path, payload.model_dump_json())
129+
130+
# Input Ports methods
131+
132+
def add_input_ports_to_data_product(
133+
self, name: str, ports: List[EntityReference]
134+
) -> Dict:
135+
"""
136+
Add input ports to a data product
137+
138+
Args:
139+
name: Name of the data product
140+
ports: List of entity references to add as input ports
141+
142+
Returns:
143+
API response as a dictionary
144+
"""
145+
return self._handle_data_product_ports(name, ports, "inputPorts", "add")
146+
147+
def remove_input_ports_from_data_product(
148+
self, name: str, ports: List[EntityReference]
149+
) -> Dict:
150+
"""
151+
Remove input ports from a data product
152+
153+
Args:
154+
name: Name of the data product
155+
ports: List of entity references to remove from input ports
156+
157+
Returns:
158+
API response as a dictionary
159+
"""
160+
return self._handle_data_product_ports(name, ports, "inputPorts", "remove")
161+
162+
# Output Ports methods
163+
164+
def add_output_ports_to_data_product(
165+
self, name: str, ports: List[EntityReference]
166+
) -> Dict:
167+
"""
168+
Add output ports to a data product
169+
170+
Args:
171+
name: Name of the data product
172+
ports: List of entity references to add as output ports
173+
174+
Returns:
175+
API response as a dictionary
176+
"""
177+
return self._handle_data_product_ports(name, ports, "outputPorts", "add")
178+
179+
def remove_output_ports_from_data_product(
180+
self, name: str, ports: List[EntityReference]
181+
) -> Dict:
182+
"""
183+
Remove output ports from a data product
184+
185+
Args:
186+
name: Name of the data product
187+
ports: List of entity references to remove from output ports
188+
189+
Returns:
190+
API response as a dictionary
191+
"""
192+
return self._handle_data_product_ports(name, ports, "outputPorts", "remove")
193+
194+
def _handle_data_product_ports(
195+
self,
196+
name: str,
197+
ports: List[EntityReference],
198+
port_type: str,
199+
operation: str,
200+
) -> Dict:
201+
"""
202+
Handle adding or removing ports from a data product
203+
204+
Args:
205+
name: Name of the data product
206+
ports: List of entity references to add/remove as ports
207+
port_type: Type of port ("inputPorts" or "outputPorts")
208+
operation: Operation to perform ("add" or "remove")
209+
210+
Returns:
211+
API response as a dictionary
212+
"""
213+
path = f"/dataProducts/{name}/{port_type}/{operation}"
214+
payload = AssetsRequest(assets=ports)
215+
216+
return self.client.put(path, payload.model_dump_json())

ingestion/src/metadata/ingestion/source/database/redshift/connection.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ def test_connection(
7878
)
7979
)
8080

81+
def test_partition_details(engine_: Engine):
82+
"""Check if we have the right permissions to get partition details"""
83+
with engine_.connect() as conn:
84+
res = conn.execute(REDSHIFT_TEST_PARTITION_DETAILS).fetchone()
85+
if not all(res):
86+
raise SourceConnectionException(
87+
f"We don't have the right permissions to get partition details - {res}"
88+
)
89+
8190
def test_get_queries_permissions(engine_: Engine):
8291
"""Check if we have the right permissions to list queries"""
8392
with engine_.connect() as conn:
@@ -96,9 +105,7 @@ def test_get_queries_permissions(engine_: Engine):
96105
"GetDatabases": partial(
97106
test_query, statement=REDSHIFT_GET_DATABASE_NAMES, engine=engine
98107
),
99-
"GetPartitionTableDetails": partial(
100-
test_query, statement=REDSHIFT_TEST_PARTITION_DETAILS, engine=engine
101-
),
108+
"GetPartitionTableDetails": partial(test_partition_details, engine),
102109
}
103110

104111
result = test_connection_steps(

ingestion/src/metadata/ingestion/source/database/redshift/queries.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,10 @@
238238
"""
239239

240240

241-
REDSHIFT_TEST_PARTITION_DETAILS = "select * from SVV_TABLE_INFO limit 1"
241+
REDSHIFT_TEST_PARTITION_DETAILS = """
242+
SELECT
243+
has_table_privilege('SVV_TABLE_INFO', 'SELECT') as can_access_svv_table_info
244+
"""
242245

243246
REDSHIFT_GET_ALL_CONSTRAINTS = """
244247
select

ingestion/src/metadata/pii/algorithms/presidio_utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"""
1414
import inspect
1515
import logging
16+
from functools import cache
1617
from typing import Any, Callable, Iterable, List, Optional, Set, Type, Union, cast
1718

1819
import spacy
@@ -43,6 +44,7 @@
4344
logger = pii_logger()
4445

4546

47+
@cache
4648
def load_nlp_engine(
4749
model_name: str = SPACY_EN_MODEL,
4850
supported_language: str = SUPPORTED_LANG,

ingestion/src/metadata/pii/tag_processor.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
TagSource,
1313
)
1414
from metadata.ingestion.ometa.ometa_api import OpenMetadata
15+
from metadata.pii.algorithms.presidio_utils import load_nlp_engine
1516
from metadata.pii.algorithms.tag_scoring import ScoreTagsForColumnService
1617
from metadata.pii.base_processor import AutoClassificationProcessor
1718
from metadata.pii.classification_manager import (
@@ -68,7 +69,9 @@ def __init__(
6869

6970
# Service that runs analyzers
7071
if score_tags_for_column is None:
71-
score_tags_for_column = ScoreTagsForColumnService()
72+
score_tags_for_column = ScoreTagsForColumnService(
73+
nlp_engine=load_nlp_engine()
74+
)
7275
self.score_tags_for_column = score_tags_for_column
7376

7477
logger.info(

0 commit comments

Comments
 (0)