mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-26 09:26:22 +00:00
fix(ingest): resolve issue with caplog and asyncio (#9377)
This commit is contained in:
parent
4ec3208918
commit
7517c77ffd
@ -550,7 +550,7 @@ class LookerModel:
|
||||
@dataclass
|
||||
class LookerViewFile:
|
||||
absolute_file_path: str
|
||||
connection: Optional[str]
|
||||
connection: Optional[LookerConnectionDefinition]
|
||||
includes: List[str]
|
||||
resolved_includes: List[ProjectInclude]
|
||||
views: List[Dict]
|
||||
|
||||
@ -3,6 +3,7 @@ from datetime import datetime
|
||||
from typing import Any, Dict, Iterable, List, Union
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
from freezegun import freeze_time
|
||||
|
||||
import datahub.metadata.schema_classes as models
|
||||
@ -482,7 +483,7 @@ def test_auto_browse_path_v2_dry_run(telemetry_ping_mock):
|
||||
|
||||
|
||||
@freeze_time("2023-01-02 00:00:00")
|
||||
def test_auto_empty_dataset_usage_statistics(caplog):
|
||||
def test_auto_empty_dataset_usage_statistics(caplog: pytest.LogCaptureFixture) -> None:
|
||||
has_urn = make_dataset_urn("my_platform", "has_aspect")
|
||||
empty_urn = make_dataset_urn("my_platform", "no_aspect")
|
||||
config = BaseTimeWindowConfig()
|
||||
@ -499,6 +500,7 @@ def test_auto_empty_dataset_usage_statistics(caplog):
|
||||
),
|
||||
).as_workunit()
|
||||
]
|
||||
caplog.clear()
|
||||
with caplog.at_level(logging.WARNING):
|
||||
new_wus = list(
|
||||
auto_empty_dataset_usage_statistics(
|
||||
@ -530,7 +532,9 @@ def test_auto_empty_dataset_usage_statistics(caplog):
|
||||
|
||||
|
||||
@freeze_time("2023-01-02 00:00:00")
|
||||
def test_auto_empty_dataset_usage_statistics_invalid_timestamp(caplog):
|
||||
def test_auto_empty_dataset_usage_statistics_invalid_timestamp(
|
||||
caplog: pytest.LogCaptureFixture,
|
||||
) -> None:
|
||||
urn = make_dataset_urn("my_platform", "my_dataset")
|
||||
config = BaseTimeWindowConfig()
|
||||
wus = [
|
||||
@ -546,6 +550,7 @@ def test_auto_empty_dataset_usage_statistics_invalid_timestamp(caplog):
|
||||
),
|
||||
).as_workunit()
|
||||
]
|
||||
caplog.clear()
|
||||
with caplog.at_level(logging.WARNING):
|
||||
new_wus = list(
|
||||
auto_empty_dataset_usage_statistics(
|
||||
|
||||
@ -5,7 +5,7 @@ import pytest
|
||||
|
||||
from datahub.utilities.perf_timer import PerfTimer
|
||||
|
||||
approx = partial(pytest.approx, rel=1e-2)
|
||||
approx = partial(pytest.approx, rel=2e-2)
|
||||
|
||||
|
||||
def test_perf_timer_simple():
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user