def test_log_dataframe(self):
    assert (os.path.exists(get_event_path(self.run_path, kind=V1ArtifactKind.DATAFRAME)) is False)
    assert (os.path.exists(get_asset_path(self.run_path, kind=V1ArtifactKind.DATAFRAME)) is False)
    df = pd.DataFrame(data=[])
    with patch('polyaxon.tracking.run.Run._log_has_events') as log_dataframe:
        self.run.log_dataframe(df=df, name='dataframe', content_type='csv')
    assert (log_dataframe.call_count == 1)
    self.event_logger.flush()
    assert (os.path.exists(get_asset_path(self.run_path, kind=V1ArtifactKind.DATAFRAME)) is True)
    assert (os.path.exists(get_event_path(self.run_path, kind=V1ArtifactKind.DATAFRAME)) is True)
    events_file = get_event_path(self.run_path, kind=V1ArtifactKind.DATAFRAME, name='dataframe')
    assert (os.path.exists(events_file) is True)
    results = V1Events.read(kind='dataframe', name='dataframe', data=events_file)
    assert (len(results.df.values) == 1)
    asset_file = get_asset_path(self.run_path, kind=V1ArtifactKind.DATAFRAME, name='dataframe', ext='csv')
    assert (os.path.exists(asset_file) is True)
def test_log_dataframe(self):
    assert (os.path.exists(get_event_path(self.run_path, kind=V1ArtifactKind.DATAFRAME)) is False)
    assert (os.path.exists(get_asset_path(self.run_path, kind=V1ArtifactKind.DATAFRAME)) is False)
    df = pd.DataFrame(data=[])
    with patch('polyaxon.tracking.run.Run._log_has_events') as log_dataframe:
        self.run.log_dataframe(df=df, name='dataframe', content_type='csv')
    assert (log_dataframe.call_count == 1)
    self.event_logger.flush()
    assert (os.path.exists(get_asset_path(self.run_path, kind=V1ArtifactKind.DATAFRAME)) is True)
    assert (os.path.exists(get_event_path(self.run_path, kind=V1ArtifactKind.DATAFRAME)) is True)
    events_file = get_event_path(self.run_path, kind=V1ArtifactKind.DATAFRAME, name='dataframe')
    assert (os.path.exists(events_file) is True)
    results = V1Events.read(kind='dataframe', name='dataframe', data=events_file)
    assert (len(results.df.values) == 1)
    asset_file = get_asset_path(self.run_path, kind=V1ArtifactKind.DATAFRAME, name='dataframe', ext='csv')
    assert (os.path.exists(asset_file) is True)