Skip to content

Commit

Permalink
fix(ingest/file): remove entity_type_counts and aspect_counts (#8586
Browse files Browse the repository at this point in the history
)
  • Loading branch information
hsheth2 authored and yoonhyejin committed Aug 24, 2023
1 parent 12e2bbd commit 855983f
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions metadata-ingestion/src/datahub/ingestion/source/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
import logging
import os.path
import pathlib
from collections import defaultdict
from dataclasses import dataclass, field
from enum import auto
from functools import partial
from io import BufferedReader
from typing import Any, Dict, Iterable, Iterator, List, Optional, Tuple, Union
from typing import Any, Iterable, Iterator, List, Optional, Tuple, Union
from urllib import parse

import ijson
Expand Down Expand Up @@ -108,8 +107,6 @@ class FileSourceReport(SourceReport):
total_parse_time_in_seconds: float = 0
total_count_time_in_seconds: float = 0
total_deserialize_time_in_seconds: float = 0
aspect_counts: Dict[str, int] = field(default_factory=lambda: defaultdict(int))
entity_type_counts: Dict[str, int] = field(default_factory=lambda: defaultdict(int))

def add_deserialize_time(self, delta: datetime.timedelta) -> None:
self.total_deserialize_time_in_seconds += round(delta.total_seconds(), 2)
Expand Down Expand Up @@ -220,15 +217,12 @@ def get_workunits_internal(
if isinstance(
obj, (MetadataChangeProposalWrapper, MetadataChangeProposal)
):
self.report.entity_type_counts[obj.entityType] += 1
if obj.aspectName is not None:
cur_aspect_name = str(obj.aspectName)
self.report.aspect_counts[cur_aspect_name] += 1
if (
self.config.aspect is not None
and cur_aspect_name != self.config.aspect
):
continue
if (
self.config.aspect is not None
and obj.aspectName is not None
and obj.aspectName != self.config.aspect
):
continue

if isinstance(obj, MetadataChangeProposalWrapper):
yield MetadataWorkUnit(id, mcp=obj)
Expand Down

0 comments on commit 855983f

Please sign in to comment.