Export to CSV bug with Django Backend

Feature(s) impacted

Export to CSV (using a django backend)

Observed behavior

I’ve observed what seems to be a bug in exporting an entire table to CSV with the Django backend setup.

To reproduce this, I press Actions → Export, I am prompted to confirm that I want to export all of the rows in my table (in the case pictured below, there are 33). However, the CSV file which is downloaded only contains 15 rows (the number of rows in my current view).

Expected behavior

I expect the CSV to contain all records belonging to my table (33 in the example pictured above).

When I was using the Node version of the backend, this feature was working as expected. However, now that I have switched over to the Django backend, I am experiencing this weird behavior.

Context

  • Project name: GumboUI
  • Team name: DepMap
  • Environment name: Production
  • Agent type & version: Django

This same issue was also reported in September of 2021, but was never resolved: Bug in export to CSV file

Hello @Sarah_Wessel,

I work on your issue, I’ll notice you when the bug will be fixed

Hello, I actually made a fix for this in one of my branches. It’s pretty minor and can be seen in this commit: Comparing ForestAdmin:main...broadinstitute:fix-csv-pagination-bug · ForestAdmin/django-forestadmin · GitHub

I believe the frontend is sending in parameters for pagination, but when exporting to CSV, we want to ignore those in order to export all rows.

What do you think of this change? (I also updated the unit tests to verify the behavior changed)

Thanks,
Phil

2 Likes