Skip to content

Commit

Permalink
fix: update csv api
Browse files Browse the repository at this point in the history
  • Loading branch information
Vespa314 committed Apr 17, 2024
1 parent 2bce77e commit 0b38bd0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DataAPI/csvAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def parse_time_column(inp):
hour = int(inp[11:13])
minute = int(inp[14:16])
else:
raise Exception(f"unknown time column from baostock:{inp}")
raise Exception(f"unknown time column from csv:{inp}")
return CTime(year, month, day, hour, minute)


Expand Down Expand Up @@ -65,7 +65,7 @@ def get_kl_data(self):
for line_number, line in enumerate(open(file_path, 'r')):
if self.headers_exist and line_number == 0:
continue
data = line.split(",")
data = line.strip("\n").split(",")
if len(data) != len(self.columns):
raise CChanException(f"file format error: {file_path}", ErrCode.SRC_DATA_FORMAT_ERROR)
if self.begin_date is not None and data[self.time_column_idx] < self.begin_date:
Expand Down

0 comments on commit 0b38bd0

Please sign in to comment.