dataframe_image icon indicating copy to clipboard operation
dataframe_image copied to clipboard

Nothing is exported if filename is pathlib.Path type

Open mborsetti opened this issue 3 years ago • 0 comments

When a pathlib.Path object is passed to dfi.export, nothing is saved and no error is raised (although pathlib.Path should be supported)

To replicate:

  1. The code below will save nothing (no errors, just no output!)
from pathlib import Path

import numpy as np

import pandas as pd

import dataframe_image as dfi

filename = Path('test.png')
pd.DataFrame(np.random.rand(6,4)).dfi.export(filename)
  1. Adding a str() will make dataframe_image work as per documentation:
pd.DataFrame(np.random.rand(6,4)).dfi.export(str(filename))

Version information:

>>> sys.version
'3.9.6 (tags/v3.9.6:db3ff76, Jun 28 2021, 15:26:21) [MSC v.1929 64 bit (AMD64)]'
>>> dfi.__version__
'0.1.1'
>>> pd.__version__
'1.3.2'

mborsetti avatar Aug 21 '21 10:08 mborsetti