You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that TableExport's parameter data_kwargs is not honoured when exporting a table.
I had to create this workaround in order to be able to set the delimiter:
class TableExportWithDelimiter(TableExport):
def export(self):
"""
Overide to provide a non standard delimiter. data_kwargs does not seem to work.
"""
return self.dataset.export(self.format, delimiter=';')
The text was updated successfully, but these errors were encountered:
tablib does not support setting the export format on the Dataset, which makes sense as that would couple it to a certain export format (CSV).
I suspected your example would only work to export to CSV, because the xlsx format does not support the delimiter kwarg, but apparently, unsupported kwargs are ignored.
We could fix this by adding another dict on ExportMixin which is passed to dataset.export(), but I'd say your custom TableExport class already looks like a good fix for non-standard use cases?
It seems that
TableExport
's parameterdata_kwargs
is not honoured when exporting a table.I had to create this workaround in order to be able to set the delimiter:
The text was updated successfully, but these errors were encountered: