Closed jorg-vr closed 1 month ago
The changes include modifications to the CsvDiffer
class in the app/helpers/renderers/csv_differ.rb
file, where a new method called padded_table
has been added. This method ensures uniform column count across rows by padding shorter rows with empty strings. The constructor has been updated to use this method when parsing CSV data. Additionally, a new test case has been introduced in the SubmissionsControllerTest
class to verify the handling of CSV files with empty rows, ensuring that the application correctly responds to such submissions.
File | Change Summary |
---|---|
app/helpers/renderers/csv_differ.rb | Added method padded_table(table) to ensure uniform column count in CSV rows; updated constructor to utilize this method for parsing CSV data. |
test/controllers/submissions_controller_test.rb | Added new test case Should be able to render submissions with csv's with empty rows to test rendering of submissions with empty rows in CSV files. Minor formatting changes made. |
sequenceDiagram
participant User
participant SubmissionsController
participant CsvDiffer
User->>SubmissionsController: GET /submissions
SubmissionsController->>CsvDiffer: Parse CSV data
CsvDiffer->>CsvDiffer: Call padded_table
CsvDiffer-->>SubmissionsController: Return padded CSV data
SubmissionsController-->>User: Render submissions
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Seeing the large reduction in codecov percentage, something probably went wrong when uploading the coverage results. Happens sometimes
This pull request fixes a bug in the csv differ that occurred when empty lines where present.
In the simplified view the diff is displayed by column. For this reason, each row needs the same amount of columns. To solve this I padded too short rows with empty string