Regression
tests.test_model.TestCorpus.test_map_metadata (from pytest)
Failing for the past 1 build
(Since Failed
)
This test is unclaimed |
Error Message
AttributeError: type object 'Corpus' has no attribute 'copy'
Stacktrace
self = <test_model.TestCorpus object at 0x7fbb40284f60> corpus = <cophi.model.Corpus object at 0x7fbb40284828> def test_map_metadata(self, corpus): metadata = pd.DataFrame({"uuid": "document", "A": "metadata"}, index=[1]) > matrix = corpus.map_metadata(corpus.dtm, metadata, fields=["A"]) tests/test_model.py:186: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ data = <class 'cophi.model.Corpus'> metadata = a b c d e f document 3 2 3 1 1 1 uuid = A uuid 1 metadata document, fields = ['A'], sep = '_' @classmethod def map_metadata(data, metadata, uuid="uuid", fields=["title"], sep="_"): """Map metadata with a UUID. Parameters: data: Data (e.g. a pandas DataFrame) to map with. metadata: Matrix with metadata, one row corresponds to one document. uuid (str): The connecting UUID between `data` and `metadata` (optional). fields (list): One or more columns of `metadata` (optional). sep (str): Glue multiple `fields` with this separator together (optional). """ > data = data.copy() # do not work on original object itself E AttributeError: type object 'Corpus' has no attribute 'copy' src/cophi/model.py:382: AttributeError