Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/Tables/utils/file_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ def convert_dataframe(
if self.file_type == FileType.Parquet and not self.ignore_header:
list_data.insert(0, list(data.columns))

if self.ignore_header and self.file_type != FileType.Parquet:
return list_data[1:]
return list_data
if return_type == TableFormat["List of dicts"]:
df_for_dicts = data
Expand Down
55 changes: 55 additions & 0 deletions tests/atest/test_reader.robot
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,61 @@ Read Row Count - CSV - With Header
${row_count} Tables.Count Table ${file_path} Rows
BuiltIn.Should Be Equal ${row_count} ${6}


# Check reading and opening of CSV file with ignore header true and false
CSV has Headers - Read CSV Table and Ignore Header
Tables.Configure Ignore Header ${True}
Tables.Count Table ${CURDIR}${/}testdata${/}example_07.csv Rows == ${57}
${data} = Tables.Read Table ${CURDIR}${/}testdata${/}example_07.csv
Length Should Be ${data} ${57}

CSV has Headers - Open CSV Table and Ignore Header
Tables.Configure Ignore Header ${True}
${alias} = Tables.Open Table ${CURDIR}${/}testdata${/}example_07.csv
Tables.Count Table ${alias} Rows == ${57}
${data} = Tables.Get Table
Length Should Be ${data} ${57}

CSV has Headers - Read CSV Table and Not Ignore Header
Tables.Configure Ignore Header ${False}
Tables.Count Table ${CURDIR}${/}testdata${/}example_07.csv Rows == ${58}
${data} = Tables.Read Table ${CURDIR}${/}testdata${/}example_07.csv
Length Should Be ${data} ${58}

CSV has Headers - Open CSV Table and Not Ignore Header
Tables.Configure Ignore Header ${False}
${alias} = Tables.Open Table ${CURDIR}${/}testdata${/}example_07.csv
Tables.Count Table ${alias} Rows == ${58}
${data} = Tables.Get Table
Length Should Be ${data} ${58}

# No headers in file!
CSV has No Headers - Read CSV Table and Ignore Header
Tables.Configure Ignore Header ${True}
Tables.Count Table ${CURDIR}${/}testdata${/}example_08.csv Rows == ${56}
${data} = Tables.Read Table ${CURDIR}${/}testdata${/}example_08.csv
Length Should Be ${data} ${56}

CSV has No Headers - Open CSV Table and Ignore Header
Tables.Configure Ignore Header ${True}
${alias} = Tables.Open Table ${CURDIR}${/}testdata${/}example_08.csv
Tables.Count Table ${alias} Rows == ${56}
${data} = Tables.Get Table
Length Should Be ${data} ${56}

CSV has No Headers - Read CSV Table and Not Ignore Header
Tables.Configure Ignore Header ${False}
Tables.Count Table ${CURDIR}${/}testdata${/}example_08.csv Rows == ${57}
${data} = Tables.Read Table ${CURDIR}${/}testdata${/}example_08.csv
Length Should Be ${data} ${57}

CSV has No Headers - Open CSV Table and Not Ignore Header
Tables.Configure Ignore Header ${False}
${alias} = Tables.Open Table ${CURDIR}${/}testdata${/}example_08.csv
Tables.Count Table ${alias} Rows == ${57}
${data} = Tables.Get Table
Length Should Be ${data} ${57}

########################################################################################
# TXT
########################################################################################
Expand Down
60 changes: 60 additions & 0 deletions tests/atest/testdata/example_07.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
Timestamp,Value
2025-11-14T12:56:00.742Z,-0.58778524
2025-11-14T12:56:01.741Z,-2.4492937e-16
2025-11-14T12:56:02.742Z,0.58778524
2025-11-14T12:56:03.742Z,0.95105654
2025-11-14T12:56:04.742Z,0.95105654
2025-11-14T12:56:07.34Z,0.58778524
2025-11-14T12:56:08.34Z,1.2246469e-16
2025-11-14T12:56:09.34Z,-0.58778524
2025-11-14T12:56:10.34Z,-0.95105654
2025-11-14T12:56:11.339Z,-0.95105654
2025-11-14T12:56:12.339Z,-0.58778524
2025-11-14T12:56:13.34Z,-2.4492937e-16
2025-11-14T12:56:14.34Z,0.58778524
2025-11-14T12:56:15.34Z,0.95105654
2025-11-14T12:56:16.339Z,0.95105654
2025-11-14T12:56:17.34Z,0.58778524
2025-11-14T12:56:18.339Z,1.2246469e-16
2025-11-14T12:56:19.34Z,-0.58778524
2025-11-14T12:56:20.34Z,-0.95105654
2025-11-14T12:56:21.34Z,-0.95105654
2025-11-14T12:56:22.339Z,-0.58778524
2025-11-14T12:56:23.34Z,-2.4492937e-16
2025-11-14T12:56:24.34Z,0.58778524
2025-11-14T12:56:25.339Z,0.95105654
2025-11-14T12:56:26.34Z,0.95105654
2025-11-14T12:56:27.34Z,0.58778524
2025-11-14T12:56:28.34Z,1.2246469e-16
2025-11-14T12:56:29.34Z,-0.58778524
2025-11-14T12:56:30.34Z,-0.95105654
2025-11-14T12:56:31.34Z,-0.95105654
2025-11-14T12:56:32.34Z,-0.58778524
2025-11-14T12:56:33.34Z,-2.4492937e-16
2025-11-14T12:56:34.34Z,0.58778524
2025-11-14T12:56:35.34Z,0.95105654
2025-11-14T12:56:36.339Z,0.95105654
2025-11-14T12:56:37.339Z,0.58778524
2025-11-14T12:56:38.339Z,1.2246469e-16
2025-11-14T12:56:40.935Z,-0.58778524
2025-11-14T12:56:41.934Z,-0.95105654
2025-11-14T12:56:42.935Z,-0.95105654
2025-11-14T12:56:43.935Z,-0.58778524
2025-11-14T12:56:44.935Z,-2.4492937e-16
2025-11-14T12:56:45.935Z,0.58778524
2025-11-14T12:56:46.934Z,0.95105654
2025-11-14T12:56:47.935Z,0.95105654
2025-11-14T12:56:48.935Z,0.58778524
2025-11-14T12:56:49.934Z,1.2246469e-16
2025-11-14T12:56:50.935Z,-0.58778524
2025-11-14T12:56:51.934Z,-0.95105654
2025-11-14T12:56:52.934Z,-0.95105654
2025-11-14T12:56:53.934Z,-0.58778524
2025-11-14T12:56:54.934Z,-2.4492937e-16
2025-11-14T12:56:55.935Z,0.58778524
2025-11-14T12:56:56.935Z,0.95105654
2025-11-14T12:56:57.935Z,0.95105654
2025-11-14T12:56:58.936Z,0.58778524
2025-11-14T12:56:59.935Z,1.2246469e-16


59 changes: 59 additions & 0 deletions tests/atest/testdata/example_08.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
2025-11-14T12:56:00.742Z,-0.58778524
2025-11-14T12:56:01.741Z,-2.4492937e-16
2025-11-14T12:56:02.742Z,0.58778524
2025-11-14T12:56:03.742Z,0.95105654
2025-11-14T12:56:04.742Z,0.95105654
2025-11-14T12:56:07.34Z,0.58778524
2025-11-14T12:56:08.34Z,1.2246469e-16
2025-11-14T12:56:09.34Z,-0.58778524
2025-11-14T12:56:10.34Z,-0.95105654
2025-11-14T12:56:11.339Z,-0.95105654
2025-11-14T12:56:12.339Z,-0.58778524
2025-11-14T12:56:13.34Z,-2.4492937e-16
2025-11-14T12:56:14.34Z,0.58778524
2025-11-14T12:56:15.34Z,0.95105654
2025-11-14T12:56:16.339Z,0.95105654
2025-11-14T12:56:17.34Z,0.58778524
2025-11-14T12:56:18.339Z,1.2246469e-16
2025-11-14T12:56:19.34Z,-0.58778524
2025-11-14T12:56:20.34Z,-0.95105654
2025-11-14T12:56:21.34Z,-0.95105654
2025-11-14T12:56:22.339Z,-0.58778524
2025-11-14T12:56:23.34Z,-2.4492937e-16
2025-11-14T12:56:24.34Z,0.58778524
2025-11-14T12:56:25.339Z,0.95105654
2025-11-14T12:56:26.34Z,0.95105654
2025-11-14T12:56:27.34Z,0.58778524
2025-11-14T12:56:28.34Z,1.2246469e-16
2025-11-14T12:56:29.34Z,-0.58778524
2025-11-14T12:56:30.34Z,-0.95105654
2025-11-14T12:56:31.34Z,-0.95105654
2025-11-14T12:56:32.34Z,-0.58778524
2025-11-14T12:56:33.34Z,-2.4492937e-16
2025-11-14T12:56:34.34Z,0.58778524
2025-11-14T12:56:35.34Z,0.95105654
2025-11-14T12:56:36.339Z,0.95105654
2025-11-14T12:56:37.339Z,0.58778524
2025-11-14T12:56:38.339Z,1.2246469e-16
2025-11-14T12:56:40.935Z,-0.58778524
2025-11-14T12:56:41.934Z,-0.95105654
2025-11-14T12:56:42.935Z,-0.95105654
2025-11-14T12:56:43.935Z,-0.58778524
2025-11-14T12:56:44.935Z,-2.4492937e-16
2025-11-14T12:56:45.935Z,0.58778524
2025-11-14T12:56:46.934Z,0.95105654
2025-11-14T12:56:47.935Z,0.95105654
2025-11-14T12:56:48.935Z,0.58778524
2025-11-14T12:56:49.934Z,1.2246469e-16
2025-11-14T12:56:50.935Z,-0.58778524
2025-11-14T12:56:51.934Z,-0.95105654
2025-11-14T12:56:52.934Z,-0.95105654
2025-11-14T12:56:53.934Z,-0.58778524
2025-11-14T12:56:54.934Z,-2.4492937e-16
2025-11-14T12:56:55.935Z,0.58778524
2025-11-14T12:56:56.935Z,0.95105654
2025-11-14T12:56:57.935Z,0.95105654
2025-11-14T12:56:58.936Z,0.58778524
2025-11-14T12:56:59.935Z,1.2246469e-16