mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-12-15 17:46:39 +00:00
* Fixes #16235: need quote fullyQualifiedName in Ingestion Framework * MINOR: fix UT issue * revert: fix UT issue * revert code * revert code * format code
This commit is contained in:
parent
015d71c9de
commit
8dd613caa5
@ -108,7 +108,9 @@ class WebAnalyticEntityViewReportDataProcessor(DataProcessor):
|
||||
|
||||
entity_obj = EntityObj(split_url[0], split_url[1])
|
||||
entity_type = entity_obj.entity_type
|
||||
re_pattern = re.compile(f"(.*{entity_type}/{entity_obj.fqn})")
|
||||
re_pattern = re.compile(
|
||||
f"(.*{re.escape(entity_type)}/{re.escape(entity_obj.fqn)})"
|
||||
)
|
||||
|
||||
if (
|
||||
entity_obj.fqn in refined_data
|
||||
|
||||
@ -290,7 +290,7 @@ class OMetaTableMixin:
|
||||
Returns:
|
||||
Optional[Table]: OM table object
|
||||
"""
|
||||
return self._get(Table, f"{quote(model_str(fqn))}/tableProfile/latest")
|
||||
return self._get(Table, f"{quote(model_str(fqn), safe='')}/tableProfile/latest")
|
||||
|
||||
def create_or_update_custom_metric(
|
||||
self, custom_metric: CreateCustomMetricRequest, table_id: str
|
||||
|
||||
@ -89,8 +89,9 @@ class User(Base):
|
||||
signedup = Column(DateTime)
|
||||
|
||||
|
||||
# with weird characters of fqn
|
||||
class NewUser(Base):
|
||||
__tablename__ = "new_users"
|
||||
__tablename__ = "new/users"
|
||||
id = Column(Integer, primary_key=True)
|
||||
name = Column(String(256))
|
||||
fullname = Column(String(256))
|
||||
@ -303,7 +304,7 @@ class ProfilerWorkflowTest(TestCase):
|
||||
{
|
||||
"type": "Profiler",
|
||||
"profileSample": 50,
|
||||
"tableFilterPattern": {"includes": ["new_users"]},
|
||||
"tableFilterPattern": {"includes": ["new/users"]},
|
||||
}
|
||||
)
|
||||
workflow_config["processor"] = {"type": "orm-profiler", "config": {}}
|
||||
@ -315,13 +316,19 @@ class ProfilerWorkflowTest(TestCase):
|
||||
|
||||
table = self.metadata.get_by_name(
|
||||
entity=Table,
|
||||
fqn="test_sqlite.main.main.new_users",
|
||||
fqn="test_sqlite.main.main.new/users",
|
||||
fields=["tableProfilerConfig"],
|
||||
)
|
||||
# setting sampleProfile from config has been temporarly removed
|
||||
# up until we split tests and profiling
|
||||
assert table.tableProfilerConfig is None
|
||||
|
||||
profile = self.metadata.get_latest_table_profile(
|
||||
table.fullyQualifiedName
|
||||
).profile
|
||||
|
||||
assert profile is not None
|
||||
|
||||
def test_workflow_datetime_partition(self):
|
||||
"""test workflow with partition"""
|
||||
workflow_config = deepcopy(ingestion_config)
|
||||
|
||||
@ -42,8 +42,8 @@ WEB_ANALYTIC_EVENTS = [
|
||||
timestamp=1667475458757,
|
||||
eventType=WebAnalyticEventType.PageView.value,
|
||||
eventData=PageViewData(
|
||||
fullUrl="http://localhost:8585/table/sample_data.ecommerce_db.shopify.dim_address",
|
||||
url="/table/sample_data.ecommerce_db.shopify.dim_address",
|
||||
fullUrl="http://localhost:8585/table/sample_data.ecommerce_db.shopify.dim(address)",
|
||||
url="/table/sample_data.ecommerce_db.shopify.dim(address)",
|
||||
hostname="localhost",
|
||||
language="en-US",
|
||||
screenSize="2140x1273",
|
||||
@ -58,8 +58,8 @@ WEB_ANALYTIC_EVENTS = [
|
||||
timestamp=1667475458757,
|
||||
eventType=WebAnalyticEventType.PageView.value,
|
||||
eventData=PageViewData(
|
||||
fullUrl="http://localhost:8585/table/sample_data.ecommerce_db.shopify.dim_address",
|
||||
url="/table/sample_data.ecommerce_db.shopify.dim_address",
|
||||
fullUrl="http://localhost:8585/table/sample_data.ecommerce_db.shopify.dim(address)",
|
||||
url="/table/sample_data.ecommerce_db.shopify.dim(address)",
|
||||
hostname="localhost",
|
||||
language="en-US",
|
||||
screenSize="2140x1273",
|
||||
@ -111,7 +111,7 @@ class WebAnalyticEntityViewReportDataProcessorTest(unittest.TestCase):
|
||||
|
||||
assert (
|
||||
web_analytic_entity_report_data[
|
||||
"sample_data.ecommerce_db.shopify.dim_address"
|
||||
"sample_data.ecommerce_db.shopify.dim(address)"
|
||||
].views
|
||||
== 2
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user