def test_write_dataframe(df_client): df1 = utils.random_dataframe() df2 = utils.random_dataframe() df2.columns = df1.columns assert df_client.write(df1, measurement='m1', mytag='foo', tag_columns=['tag']) assert df_client.write(df2, measurement='m2', mytag='foo', tag_columns=['tag']) assert df_client.write(utils.random_dataframe(), measurement='m3') # tag-less
def test_invalid_data_write_dataframe(sync_client): with pytest.raises(ValueError) as e: # Non-DatetimeIndex DataFrame sync_client.write(utils.random_dataframe().reset_index(), measurement='foo') logger.error(e) with pytest.raises(ValueError) as e: # DataFrame write without specifying measurement sync_client.write(utils.random_dataframe()) logger.error(e)
def test_write_dataframe(df_client): assert df_client.write(utils.random_dataframe(), measurement='test_measurement', mytag='foo', tag_columns=['tag'])