Skip to content

Commit

Permalink
dann halt nicht
Browse files Browse the repository at this point in the history
  • Loading branch information
hf-kklein committed May 17, 2024
1 parent f4cdcfc commit bda69b6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/kohlrahbi/ahbtable/ahbtable.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def append_ahb_sub_table(self, ahb_sub_table: AhbSubTable) -> None:
self.table = pd.concat([self.table, ahb_sub_table.table], ignore_index=True)

@staticmethod
def line_contains_only_segment_gruppe(raw_line: pd.Series[str]) -> bool:
def line_contains_only_segment_gruppe(raw_line: pd.Series) -> bool: # type:ignore[type-arg]
"""
Returns true if the given raw line only contains some meaningful data in the "Segment Gruppe" key
"""
Expand Down
4 changes: 3 additions & 1 deletion src/kohlrahbi/ahbtable/ahbtablerow.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ def parse(
dtype="str",
)
# pylint: disable=unsubscriptable-object, no-member
empty_row: pd.Series[str] = pd.Series(len(ahb_row_dataframe.columns) * [""], index=self.seed.column_headers)
empty_row: pd.Series = pd.Series(
len(ahb_row_dataframe.columns) * [""], index=self.seed.column_headers
) # type:ignore[type-arg]

ahb_row_dataframe = pd.concat([ahb_row_dataframe, empty_row.to_frame().T], ignore_index=True)

Expand Down
2 changes: 1 addition & 1 deletion src/kohlrahbi/changehistory/changehistorytable.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def is_empty(val: str) -> bool:
return pd.isna(val) or val == ""

# Define a function to check if a value is considered empty for our case
def is_the_first_column_empty(row: pd.Series[str]) -> bool:
def is_the_first_column_empty(row: pd.Series) -> bool: # type:ignore[type-arg]
"""
Checks if the first column of the given row is empty.
This is our indicator if the current row is a continuation of the upper row.
Expand Down
14 changes: 7 additions & 7 deletions src/kohlrahbi/unfoldedahb/unfoldedahbtable.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def _get_section_name(segment_gruppe_or_section_name: str, last_section_name: st
return last_section_name

@staticmethod
def _is_section_name(ahb_row: pd.Series[str]) -> bool:
def _is_section_name(ahb_row: pd.Series) -> bool: # type:ignore[type-arg]
"""
Checks if the current AHB row is a section name.
It uses the same logic as the function 'line_contains_only_segment_gruppe'
Expand All @@ -245,15 +245,15 @@ def _is_section_name(ahb_row: pd.Series[str]) -> bool:
return AhbTable.line_contains_only_segment_gruppe(ahb_row)

@staticmethod
def _is_segment_group(ahb_row: pd.Series[str]) -> bool:
def _is_segment_group(ahb_row: pd.Series) -> bool: # type:ignore[type-arg]
"""Checks if the current AHB row is a segment group."""

if _segment_group_pattern.match(ahb_row["Segment Gruppe"]) and not ahb_row["Segment"]:
return True
return False

@staticmethod
def _is_segment_opening_line(ahb_row: pd.Series[str]) -> bool:
def _is_segment_opening_line(ahb_row: pd.Series) -> bool: # type:ignore[type-arg]
"""Checks if the current AHB row is a segment opening line.
Example:
Expand All @@ -273,7 +273,7 @@ def _is_segment_opening_line(ahb_row: pd.Series[str]) -> bool:
return False

@staticmethod
def _is_just_segment(ahb_row: pd.Series[str]) -> bool:
def _is_just_segment(ahb_row: pd.Series) -> bool: # type:ignore[type-arg]
"""
Checks if the given AHB row is a segment
"""
Expand All @@ -287,7 +287,7 @@ def _is_just_segment(ahb_row: pd.Series[str]) -> bool:
return False

@staticmethod
def _is_dataelement(ahb_row: pd.Series[str]) -> bool:
def _is_dataelement(ahb_row: pd.Series) -> bool: # type:ignore[type-arg]
"""
Checks if the given AHB row is a dataelement
"""
Expand All @@ -296,12 +296,12 @@ def _is_dataelement(ahb_row: pd.Series[str]) -> bool:
return False

@staticmethod
def _is_just_value_pool_entry(ahb_row: pd.Series[str]) -> bool:
def _is_just_value_pool_entry(ahb_row: pd.Series) -> bool: # type:ignore[type-arg]
"""
Checks if the given AHB row contains only a value pool entry (w/o Segment (group) and data element)
"""
return (
(not ahb_row["Segment Gruppe"]) # type:ignore[return-value]
(not ahb_row["Segment Gruppe"])
and (not ahb_row["Segment"])
and (not ahb_row["Datenelement"])
and ahb_row["Codes und Qualifier"]
Expand Down

0 comments on commit bda69b6

Please sign in to comment.