anhaidgroup / py_entitymatching

BSD 3-Clause "New" or "Revised" License
185 stars 48 forks source link

Update the following assertion errors in to_csv_metadata #55

Open kvpradap opened 7 years ago

kvpradap commented 7 years ago

In the following code,

if not isinstance(data_frame, pd.DataFrame):
    logging.error('Input dataframe is not of type pandas dataframe')
    raise AssertionError('Input dataframe is not of type pandas dataframe')

The error, does not include the current type of input. Update the error, including the type of input object.

Further in this code,

if not isinstance(file_path, six.string_types): logger.error('Input file path is not of type string') raise AssertionError('Input file path is not of type string')

The input file path should be included in the error strings by trying to convert input file_path. If it fails, the error message need not include the given file_path.