Skip to content

Commit 6f5464a

Browse files
committed
refactor __IN_NOTES_INDEX to __IN_LEN as last idx
1 parent 30a4005 commit 6f5464a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/dali/plugin/input/csv/manual.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class InputPlugin(AbstractInputPlugin):
5353
__IN_FIAT_FEE_INDEX: int = 11
5454
__IN_NOTES_INDEX: int = 12
5555
__IN_FIAT_TICKER: int = 13
56+
__IN_LEN = __IN_FIAT_TICKER
5657

5758
__OUT_UNIQUE_ID_INDEX: int = 0
5859
__OUT_TIMESTAMP_INDEX: int = 1
@@ -120,15 +121,15 @@ def _load_in_file(self, transactions: List[AbstractTransaction]) -> None:
120121
raw_data: str = ",".join(line).strip()
121122
if not header_found:
122123
# let user know there is not enough columns
123-
if len(line) - 1 < self.__IN_NOTES_INDEX:
124-
raise ValueError(f"Not enough columns: the {self.__in_csv_file} CSV must contain {self.__IN_NOTES_INDEX} columns.")
124+
if len(line) - 1 < self.__IN_LEN:
125+
raise ValueError(f"Not enough columns: the {self.__in_csv_file} CSV must contain {self.__IN_LEN} columns.")
125126

126127
# Skip header line
127128
header_found = True
128129
self.__logger.debug("Header: %s", ";".join(line))
129130
continue
130131

131-
if raw_data.startswith("," * self.__IN_NOTES_INDEX):
132+
if raw_data.startswith("," * self.__IN_LEN):
132133
# Skip empty lines
133134
continue
134135

0 commit comments

Comments
 (0)