Skip to content

Commit

Permalink
Merge pull request #24 from opendatadiscovery/chore/field_oddrn
Browse files Browse the repository at this point in the history
chore: removed redundant field_oddrn parameter
  • Loading branch information
Vixtir committed Oct 31, 2023
2 parents c1967ac + 3c8682b commit 89f8e10
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion odd_collector_profiler/datasource/database/profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def get_statistics(self) -> DatasetStatisticsList:
fields = {}
for field_stat in profile:
field_oddrn = self.get_field_oddrn(field_stat)
fields[field_oddrn] = field_stat.to_odd(oddrn=field_oddrn)
fields[field_oddrn] = field_stat.to_odd()
items.append(DataSetStatistics(dataset_oddrn=dataset_oddrn, fields=fields))

return DatasetStatisticsList(items=items)
Expand Down
4 changes: 2 additions & 2 deletions odd_collector_profiler/domain/statistics/column_statistic.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ def __init__(
self.column_name = column_name
self.tags = tags or []

def to_odd(self, oddrn: str) -> DataSetFieldStat:
def to_odd(self) -> DataSetFieldStat:
tags = [Tag(name=name) for name in self.tags]
return DataSetFieldStat(tags=tags, field_oddrn=oddrn)
return DataSetFieldStat(tags=tags)
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def __init__(
self.nulls_count = nulls_count
self.unique_count = unique_count

def to_odd(self, oddrn: str) -> DataSetFieldStat:
data_entity = super().to_odd(oddrn)
def to_odd(self) -> DataSetFieldStat:
data_entity = super().to_odd()
data_entity.datetime_stats = DateTimeFieldStat(
low_value=self.low_value.replace(tzinfo=pytz.utc).isoformat(),
high_value=self.high_value.replace(tzinfo=pytz.utc).isoformat(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def __init__(
self.nulls_count = nulls_count
self.unique_count = unique_count

def to_odd(self, oddrn: str) -> DataSetFieldStat:
data_entity = super().to_odd(oddrn)
def to_odd(self) -> DataSetFieldStat:
data_entity = super().to_odd()
data_entity.integer_stats = IntegerFieldStat(
low_value=self.low_value,
high_value=self.high_value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def __init__(
self.nulls_count = nulls_count
self.unique_count = unique_count

def to_odd(self, oddrn: str) -> DataSetFieldStat:
data_entity = super().to_odd(oddrn)
def to_odd(self) -> DataSetFieldStat:
data_entity = super().to_odd()
data_entity.number_stats = NumberFieldStat(
low_value=self.low_value,
high_value=self.high_value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ def __init__(
self.nulls_count = nulls_count
self.unique_count = unique_count

def to_odd(self, oddrn: str) -> DataSetFieldStat:
data_entity = super().to_odd(oddrn)
def to_odd(self) -> DataSetFieldStat:
data_entity = super().to_odd()
data_entity.string_stats = StringFieldStat(
max_length=self.max_length,
avg_length=round(self.avg_length),
Expand Down

0 comments on commit 89f8e10

Please sign in to comment.