Hello community,
here is the log from the commit of package python-influxdb for openSUSE:Factory
checked in at 2019-01-28 20:48:40
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-influxdb (Old)
and /work/SRC/openSUSE:Factory/.python-influxdb.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-influxdb"
Mon Jan 28 20:48:40 2019 rev:3 rq:668895 version:5.1.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-influxdb/python-influxdb.changes
2018-12-24 11:38:27.785608053 +0100
+++
/work/SRC/openSUSE:Factory/.python-influxdb.new.28833/python-influxdb.changes
2019-01-28 20:49:41.649826124 +0100
@@ -1,0 +2,21 @@
+Sun Jan 27 06:43:00 UTC 2019 - Thomas Bechtold <[email protected]>
+
+- update to version v5.1.0
+ * README: add PyPI status
+ * Escape tag values that ends with backslash (#537)
+ * Fix for DataFrameClient issue - seems does not process correctly
DateTimeIndex dates (issue #479) (#495)
+ * Fix pandas example (#547)
+ * Fix wrong session mount (#571)
+ * set version to 5.1.0
+ * DataFrameClient should escape measurement names (#542)
+ * doc: clarify that send_packet takes a list (#545)
+ * specify the numpy dependency explicitly to prevent regression in test
(#563)
+ * Parse column names in a dataframe to avoid breaking the line protocol
(#584)
+ * adding back dropped database param
+ * Allow connecting to influxdb running on a path on the server (#556)
+ * Remove comment as issues have been resolved (#581)
+ * Remove UDP Precision Restrictions (#557)
+ * Update _dataframe_client.py (#593)
+ * README: styling
+
+-------------------------------------------------------------------
Old:
----
influxdb-5.0.0.tar.gz
New:
----
influxdb-5.1.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-influxdb.spec ++++++
--- /var/tmp/diff_new_pack.t27OjD/_old 2019-01-28 20:49:42.153825593 +0100
+++ /var/tmp/diff_new_pack.t27OjD/_new 2019-01-28 20:49:42.153825593 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-influxdb
#
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-influxdb
-Version: 5.0.0
+Version: 5.1.0
Release: 0
Summary: InfluxDB client
License: MIT
@@ -39,10 +39,10 @@
%if 0%{?suse_version} >= 1500
BuildRequires: hostname
%endif
-Requires: python-python-dateutil >= 2.0.0
+Requires: python-python-dateutil >= 2.6.0
Requires: python-pytz
-Requires: python-requests >= 1.0.3
-Requires: python-six >= 1.9.0
+Requires: python-requests >= 1.17.0
+Requires: python-six >= 1.10.0
BuildArch: noarch
%python_subpackages
++++++ influxdb-5.0.0.tar.gz -> influxdb-5.1.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/influxdb-5.0.0/PKG-INFO new/influxdb-5.1.0/PKG-INFO
--- old/influxdb-5.0.0/PKG-INFO 2017-11-21 06:01:29.000000000 +0100
+++ new/influxdb-5.1.0/PKG-INFO 2018-06-27 01:17:23.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: influxdb
-Version: 5.0.0
+Version: 5.1.0
Summary: InfluxDB client
Home-page: https://github.com/influxdb/influxdb-python
Author: UNKNOWN
@@ -11,7 +11,6 @@
.. image::
https://travis-ci.org/influxdata/influxdb-python.svg?branch=master
:target: https://travis-ci.org/influxdata/influxdb-python
-
.. image::
https://readthedocs.org/projects/influxdb-python/badge/?version=latest&style
:target: http://influxdb-python.readthedocs.org/
:alt: Documentation Status
@@ -20,9 +19,13 @@
:target: https://coveralls.io/r/influxdata/influxdb-python
:alt: Coverage
+ .. image:: https://img.shields.io/pypi/v/influxdb.svg
+ :target: https://pypi.python.org/pypi/influxdb
+ :alt: PyPI Status
+ InfluxDB-Python is a client for interacting with InfluxDB_.
- InfluxDB-Python is a client for interacting with InfluxDB_.
Development of this library is maintained by
+ Development of this library is maintained by:
+-----------+-------------------------------+
| Github ID | URL |
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/influxdb-5.0.0/README.rst
new/influxdb-5.1.0/README.rst
--- old/influxdb-5.0.0/README.rst 2017-11-21 06:01:25.000000000 +0100
+++ new/influxdb-5.1.0/README.rst 2018-06-27 01:17:19.000000000 +0200
@@ -3,7 +3,6 @@
.. image:: https://travis-ci.org/influxdata/influxdb-python.svg?branch=master
:target: https://travis-ci.org/influxdata/influxdb-python
-
.. image::
https://readthedocs.org/projects/influxdb-python/badge/?version=latest&style
:target: http://influxdb-python.readthedocs.org/
:alt: Documentation Status
@@ -12,9 +11,13 @@
:target: https://coveralls.io/r/influxdata/influxdb-python
:alt: Coverage
+.. image:: https://img.shields.io/pypi/v/influxdb.svg
+ :target: https://pypi.python.org/pypi/influxdb
+ :alt: PyPI Status
+InfluxDB-Python is a client for interacting with InfluxDB_.
-InfluxDB-Python is a client for interacting with InfluxDB_. Development of
this library is maintained by
+Development of this library is maintained by:
+-----------+-------------------------------+
| Github ID | URL |
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/influxdb-5.0.0/influxdb/__init__.py
new/influxdb-5.1.0/influxdb/__init__.py
--- old/influxdb-5.0.0/influxdb/__init__.py 2017-11-21 06:01:25.000000000
+0100
+++ new/influxdb-5.1.0/influxdb/__init__.py 2018-06-27 01:17:19.000000000
+0200
@@ -18,4 +18,4 @@
]
-__version__ = '5.0.0'
+__version__ = '5.1.0'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/influxdb-5.0.0/influxdb/_dataframe_client.py
new/influxdb-5.1.0/influxdb/_dataframe_client.py
--- old/influxdb-5.0.0/influxdb/_dataframe_client.py 2017-11-21
06:01:25.000000000 +0100
+++ new/influxdb-5.1.0/influxdb/_dataframe_client.py 2018-06-27
01:17:19.000000000 +0200
@@ -10,6 +10,7 @@
from collections import defaultdict
import pandas as pd
+import numpy as np
from .client import InfluxDBClient
from .line_protocol import _escape_tag
@@ -174,6 +175,7 @@
expected_response_code=expected_response_code,
raise_errors=raise_errors,
chunked=chunked,
+ database=database,
chunk_size=chunk_size)
results = super(DataFrameClient, self).query(query, **query_args)
if query.strip().upper().startswith("SELECT"):
@@ -234,7 +236,7 @@
field_columns = list(
set(dataframe.columns).difference(set(tag_columns)))
- dataframe.index = dataframe.index.to_datetime()
+ dataframe.index = pd.to_datetime(dataframe.index)
if dataframe.index.tzinfo is None:
dataframe.index = dataframe.index.tz_localize('UTC')
@@ -257,7 +259,7 @@
{'measurement': measurement,
'tags': dict(list(tag.items()) + list(tags.items())),
'fields': rec,
- 'time': int(ts.value / precision_factor)}
+ 'time': np.int64(ts.value / precision_factor)}
for ts, tag, rec in zip(dataframe.index,
dataframe[tag_columns].to_dict('record'),
dataframe[field_columns].to_dict('record'))
@@ -274,6 +276,10 @@
time_precision=None,
numeric_precision=None):
+ dataframe = dataframe.dropna(how='all').copy()
+ if len(dataframe) == 0:
+ return []
+
if not isinstance(dataframe, pd.DataFrame):
raise TypeError('Must be DataFrame, but type was: {0}.'
.format(type(dataframe)))
@@ -282,6 +288,8 @@
raise TypeError('Must be DataFrame with DatetimeIndex or '
'PeriodIndex.')
+ dataframe = dataframe.rename(
+ columns={item: _escape_tag(item) for item in dataframe.columns})
# Create a Series of columns for easier indexing
column_series = pd.Series(dataframe.columns)
@@ -319,11 +327,11 @@
# Make array of timestamp ints
if isinstance(dataframe.index, pd.PeriodIndex):
- time = ((dataframe.index.to_timestamp().values.astype(int) /
- precision_factor).astype(int).astype(str))
+ time = ((dataframe.index.to_timestamp().values.astype(np.int64) /
+ precision_factor).astype(np.int64).astype(str))
else:
- time = ((pd.to_datetime(dataframe.index).values.astype(int) /
- precision_factor).astype(int).astype(str))
+ time = ((pd.to_datetime(dataframe.index).values.astype(np.int64) /
+ precision_factor).astype(np.int64).astype(str))
# If tag columns exist, make an array of formatted tag keys and values
if tag_columns:
@@ -357,20 +365,32 @@
# Make an array of formatted field keys and values
field_df = dataframe[field_columns]
+
field_df = self._stringify_dataframe(field_df,
numeric_precision,
datatype='field')
- field_df = (field_df.columns.values + '=').tolist() + field_df
- field_df[field_df.columns[1:]] = ',' + field_df[field_df.columns[1:]]
- fields = field_df.sum(axis=1)
+
+ def format_line(line):
+ line = line[~line.isnull()] # drop None entries
+ return ",".join((line.index + '=' + line.values))
+
+ fields = field_df.apply(format_line, axis=1)
del field_df
# Generate line protocol string
+ measurement = _escape_tag(measurement)
points = (measurement + tags + ' ' + fields + ' ' + time).tolist()
return points
@staticmethod
def _stringify_dataframe(dframe, numeric_precision, datatype='field'):
+
+ # Prevent modification of input dataframe
+ dframe = dframe.copy()
+
+ # Keep the positions where Null values are found
+ mask_null = dframe.isnull().values
+
# Find int and string columns for field-type data
int_columns = dframe.select_dtypes(include=['integer']).columns
string_columns = dframe.select_dtypes(include=['object']).columns
@@ -414,6 +434,8 @@
dframe = dframe.apply(_escape_pandas_series)
dframe.columns = dframe.columns.astype(str)
+
+ dframe = dframe.where(~mask_null, None)
return dframe
def _datetime_to_epoch(self, datetime, time_precision='s'):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/influxdb-5.0.0/influxdb/client.py
new/influxdb-5.1.0/influxdb/client.py
--- old/influxdb-5.0.0/influxdb/client.py 2017-11-21 06:01:25.000000000
+0100
+++ new/influxdb-5.1.0/influxdb/client.py 2018-06-27 01:17:19.000000000
+0200
@@ -59,6 +59,8 @@
:type udp_port: int
:param proxies: HTTP(S) proxy to use for Requests, defaults to {}
:type proxies: dict
+ :param path: path of InfluxDB on the server to connect, defaults to ''
+ :type path: str
"""
def __init__(self,
@@ -75,6 +77,7 @@
udp_port=4444,
proxies=None,
pool_size=10,
+ path='',
):
"""Construct a new InfluxDBClient object."""
self.__host = host
@@ -98,22 +101,30 @@
if use_udp:
self.udp_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+ if not path:
+ self.__path = ''
+ elif path[0] == '/':
+ self.__path = path
+ else:
+ self.__path = '/' + path
+
self._scheme = "http"
if ssl is True:
self._scheme = "https"
- self._session.mount(self._scheme, adapter)
+ self._session.mount(self._scheme + '://', adapter)
if proxies is None:
self._proxies = {}
else:
self._proxies = proxies
- self.__baseurl = "{0}://{1}:{2}".format(
+ self.__baseurl = "{0}://{1}:{2}{3}".format(
self._scheme,
self._host,
- self._port)
+ self._port,
+ self._path)
self._headers = {
'Content-Type': 'application/json',
@@ -133,6 +144,10 @@
return self.__port
@property
+ def _path(self):
+ return self.__path
+
+ @property
def _udp_port(self):
return self.__udp_port
@@ -497,11 +512,6 @@
"Invalid time precision is given. "
"(use 'n', 'u', 'ms', 's', 'm' or 'h')")
- if self._use_udp and time_precision and time_precision != 's':
- raise ValueError(
- "InfluxDB only supports seconds precision for udp writes"
- )
-
if protocol == 'json':
data = {
'points': points
@@ -523,7 +533,9 @@
params['rp'] = retention_policy
if self._use_udp:
- self.send_packet(data, protocol=protocol)
+ self.send_packet(
+ data, protocol=protocol, time_precision=time_precision
+ )
else:
self.write(
data=data,
@@ -864,17 +876,19 @@
text = "SHOW GRANTS FOR {0}".format(quote_ident(username))
return list(self.query(text).get_points())
- def send_packet(self, packet, protocol='json'):
+ def send_packet(self, packet, protocol='json', time_precision=None):
"""Send an UDP packet.
:param packet: the packet to be sent
:type packet: (if protocol is 'json') dict
- (if protocol is 'line') sequence of line protocol strings
+ (if protocol is 'line') list of line protocol strings
:param protocol: protocol of input data, either 'json' or 'line'
:type protocol: str
+ :param time_precision: Either 's', 'm', 'ms' or 'u', defaults to None
+ :type time_precision: str
"""
if protocol == 'json':
- data = make_lines(packet).encode('utf-8')
+ data = make_lines(packet, time_precision).encode('utf-8')
elif protocol == 'line':
data = ('\n'.join(packet) + '\n').encode('utf-8')
self.udp_socket.sendto(data, (self._host, self._udp_port))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/influxdb-5.0.0/influxdb/line_protocol.py
new/influxdb-5.1.0/influxdb/line_protocol.py
--- old/influxdb-5.0.0/influxdb/line_protocol.py 2017-11-21
06:01:25.000000000 +0100
+++ new/influxdb-5.1.0/influxdb/line_protocol.py 2018-06-27
01:17:19.000000000 +0200
@@ -57,6 +57,13 @@
)
+def _escape_tag_value(value):
+ ret = _escape_tag(value)
+ if ret.endswith('\\'):
+ ret += ' '
+ return ret
+
+
def quote_ident(value):
"""Indent the quotes."""
return "\"{}\"".format(value
@@ -135,7 +142,7 @@
# tags should be sorted client-side to take load off server
for tag_key, tag_value in sorted(iteritems(tags)):
key = _escape_tag(tag_key)
- value = _escape_tag(tag_value)
+ value = _escape_tag_value(tag_value)
if key != '' and value != '':
key_values.append(key + "=" + value)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/influxdb-5.0.0/influxdb/tests/client_test.py
new/influxdb-5.1.0/influxdb/tests/client_test.py
--- old/influxdb-5.0.0/influxdb/tests/client_test.py 2017-11-21
06:01:25.000000000 +0100
+++ new/influxdb-5.1.0/influxdb/tests/client_test.py 2018-06-27
01:17:19.000000000 +0200
@@ -109,6 +109,24 @@
)
self.assertEqual('https://host:8086', cli._baseurl)
+ cli = InfluxDBClient(
+ 'host', 8086, 'username', 'password', 'database', ssl=True,
+ path="somepath"
+ )
+ self.assertEqual('https://host:8086/somepath', cli._baseurl)
+
+ cli = InfluxDBClient(
+ 'host', 8086, 'username', 'password', 'database', ssl=True,
+ path=None
+ )
+ self.assertEqual('https://host:8086', cli._baseurl)
+
+ cli = InfluxDBClient(
+ 'host', 8086, 'username', 'password', 'database', ssl=True,
+ path="/somepath"
+ )
+ self.assertEqual('https://host:8086/somepath', cli._baseurl)
+
def test_dsn(self):
"""Set up the test datasource name for TestInfluxDBClient object."""
cli = InfluxDBClient.from_dsn('influxdb://192.168.0.1:1886')
@@ -259,22 +277,6 @@
received_data.decode()
)
- def test_write_bad_precision_udp(self):
- """Test write bad precision in UDP for TestInfluxDBClient object."""
- cli = InfluxDBClient(
- 'localhost', 8086, 'root', 'root',
- 'test', use_udp=True, udp_port=4444
- )
-
- with self.assertRaisesRegexp(
- Exception,
- "InfluxDB only supports seconds precision for udp writes"
- ):
- cli.write_points(
- self.dummy_points,
- time_precision='ms'
- )
-
@raises(Exception)
def test_write_points_fails(self):
"""Test write points fail for TestInfluxDBClient object."""
@@ -335,6 +337,65 @@
m.last_request.body,
)
+ def test_write_points_with_precision_udp(self):
+ """Test write points with precision for TestInfluxDBClient object."""
+ s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+ port = random.randint(4000, 8000)
+ s.bind(('0.0.0.0', port))
+
+ cli = InfluxDBClient(
+ 'localhost', 8086, 'root', 'root',
+ 'test', use_udp=True, udp_port=port
+ )
+
+ cli.write_points(self.dummy_points, time_precision='n')
+ received_data, addr = s.recvfrom(1024)
+ self.assertEqual(
+ b'cpu_load_short,host=server01,region=us-west '
+ b'value=0.64 1257894000123456000\n',
+ received_data,
+ )
+
+ cli.write_points(self.dummy_points, time_precision='u')
+ received_data, addr = s.recvfrom(1024)
+ self.assertEqual(
+ b'cpu_load_short,host=server01,region=us-west '
+ b'value=0.64 1257894000123456\n',
+ received_data,
+ )
+
+ cli.write_points(self.dummy_points, time_precision='ms')
+ received_data, addr = s.recvfrom(1024)
+ self.assertEqual(
+ b'cpu_load_short,host=server01,region=us-west '
+ b'value=0.64 1257894000123\n',
+ received_data,
+ )
+
+ cli.write_points(self.dummy_points, time_precision='s')
+ received_data, addr = s.recvfrom(1024)
+ self.assertEqual(
+ b"cpu_load_short,host=server01,region=us-west "
+ b"value=0.64 1257894000\n",
+ received_data,
+ )
+
+ cli.write_points(self.dummy_points, time_precision='m')
+ received_data, addr = s.recvfrom(1024)
+ self.assertEqual(
+ b'cpu_load_short,host=server01,region=us-west '
+ b'value=0.64 20964900\n',
+ received_data,
+ )
+
+ cli.write_points(self.dummy_points, time_precision='h')
+ received_data, addr = s.recvfrom(1024)
+ self.assertEqual(
+ b'cpu_load_short,host=server01,region=us-west '
+ b'value=0.64 349415\n',
+ received_data,
+ )
+
def test_write_points_bad_precision(self):
"""Test write points w/bad precision TestInfluxDBClient object."""
cli = InfluxDBClient()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/influxdb-5.0.0/influxdb/tests/dataframe_client_test.py
new/influxdb-5.1.0/influxdb/tests/dataframe_client_test.py
--- old/influxdb-5.0.0/influxdb/tests/dataframe_client_test.py 2017-11-21
06:01:25.000000000 +0100
+++ new/influxdb-5.1.0/influxdb/tests/dataframe_client_test.py 2018-06-27
01:17:19.000000000 +0200
@@ -59,6 +59,123 @@
cli.write_points(dataframe, 'foo', tags=None)
self.assertEqual(m.last_request.body, expected)
+ def test_dataframe_write_points_with_whitespace_measurement(self):
+ """write_points should escape white space in measurements."""
+ now = pd.Timestamp('1970-01-01 00:00+00:00')
+ dataframe = pd.DataFrame(data=[["1", 1, 1.0], ["2", 2, 2.0]],
+ index=[now, now + timedelta(hours=1)],
+ columns=["column_one", "column_two",
+ "column_three"])
+ expected = (
+ b"meas\\ with\\ space "
+ b"column_one=\"1\",column_two=1i,column_three=1.0 0\n"
+ b"meas\\ with\\ space "
+ b"column_one=\"2\",column_two=2i,column_three=2.0 "
+ b"3600000000000\n"
+ )
+ with requests_mock.Mocker() as m:
+ m.register_uri(requests_mock.POST,
+ "http://localhost:8086/write",
+ status_code=204)
+ cli = DataFrameClient(database='db')
+ cli.write_points(dataframe, 'meas with space')
+ self.assertEqual(m.last_request.body, expected)
+
+ def test_dataframe_write_points_with_whitespace_in_column_names(self):
+ """write_points should escape white space in column names."""
+ now = pd.Timestamp('1970-01-01 00:00+00:00')
+ dataframe = pd.DataFrame(data=[["1", 1, 1.0], ["2", 2, 2.0]],
+ index=[now, now + timedelta(hours=1)],
+ columns=["column one", "column two",
+ "column three"])
+ expected = (
+ b"foo column\\ one=\"1\",column\\ two=1i,column\\ three=1.0 0\n"
+ b"foo column\\ one=\"2\",column\\ two=2i,column\\ three=2.0 "
+ b"3600000000000\n"
+ )
+ with requests_mock.Mocker() as m:
+ m.register_uri(requests_mock.POST,
+ "http://localhost:8086/write",
+ status_code=204)
+ cli = DataFrameClient(database='db')
+ cli.write_points(dataframe, 'foo')
+ self.assertEqual(m.last_request.body, expected)
+
+ def test_write_points_from_dataframe_with_none(self):
+ """Test write points from df in TestDataFrameClient object."""
+ now = pd.Timestamp('1970-01-01 00:00+00:00')
+ dataframe = pd.DataFrame(data=[["1", None, 1.0], ["2", 2.0, 2.0]],
+ index=[now, now + timedelta(hours=1)],
+ columns=["column_one", "column_two",
+ "column_three"])
+ expected = (
+ b"foo column_one=\"1\",column_three=1.0 0\n"
+ b"foo column_one=\"2\",column_two=2.0,column_three=2.0 "
+ b"3600000000000\n"
+ )
+
+ with requests_mock.Mocker() as m:
+ m.register_uri(requests_mock.POST,
+ "http://localhost:8086/write",
+ status_code=204)
+
+ cli = DataFrameClient(database='db')
+
+ cli.write_points(dataframe, 'foo')
+ self.assertEqual(m.last_request.body, expected)
+
+ cli.write_points(dataframe, 'foo', tags=None)
+ self.assertEqual(m.last_request.body, expected)
+
+ def test_write_points_from_dataframe_with_line_of_none(self):
+ """Test write points from df in TestDataFrameClient object."""
+ now = pd.Timestamp('1970-01-01 00:00+00:00')
+ dataframe = pd.DataFrame(data=[[None, None, None], ["2", 2.0, 2.0]],
+ index=[now, now + timedelta(hours=1)],
+ columns=["column_one", "column_two",
+ "column_three"])
+ expected = (
+ b"foo column_one=\"2\",column_two=2.0,column_three=2.0 "
+ b"3600000000000\n"
+ )
+
+ with requests_mock.Mocker() as m:
+ m.register_uri(requests_mock.POST,
+ "http://localhost:8086/write",
+ status_code=204)
+
+ cli = DataFrameClient(database='db')
+
+ cli.write_points(dataframe, 'foo')
+ self.assertEqual(m.last_request.body, expected)
+
+ cli.write_points(dataframe, 'foo', tags=None)
+ self.assertEqual(m.last_request.body, expected)
+
+ def test_write_points_from_dataframe_with_all_none(self):
+ """Test write points from df in TestDataFrameClient object."""
+ now = pd.Timestamp('1970-01-01 00:00+00:00')
+ dataframe = pd.DataFrame(data=[[None, None, None], [None, None, None]],
+ index=[now, now + timedelta(hours=1)],
+ columns=["column_one", "column_two",
+ "column_three"])
+ expected = (
+ b"\n"
+ )
+
+ with requests_mock.Mocker() as m:
+ m.register_uri(requests_mock.POST,
+ "http://localhost:8086/write",
+ status_code=204)
+
+ cli = DataFrameClient(database='db')
+
+ cli.write_points(dataframe, 'foo')
+ self.assertEqual(m.last_request.body, expected)
+
+ cli.write_points(dataframe, 'foo', tags=None)
+ self.assertEqual(m.last_request.body, expected)
+
def test_write_points_from_dataframe_in_batches(self):
"""Test write points in batch from df in TestDataFrameClient object."""
now = pd.Timestamp('1970-01-01 00:00+00:00')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/influxdb-5.0.0/influxdb/tests/test_line_protocol.py
new/influxdb-5.1.0/influxdb/tests/test_line_protocol.py
--- old/influxdb-5.0.0/influxdb/tests/test_line_protocol.py 2017-11-21
06:01:25.000000000 +0100
+++ new/influxdb-5.1.0/influxdb/tests/test_line_protocol.py 2018-06-27
01:17:19.000000000 +0200
@@ -22,6 +22,7 @@
"tags": {
"empty_tag": "",
"none_tag": None,
+ "backslash_tag": "C:\\",
"integer_tag": 2,
"string_tag": "hello"
},
@@ -41,7 +42,7 @@
self.assertEqual(
line_protocol.make_lines(data),
- 'test,integer_tag=2,string_tag=hello '
+ 'test,backslash_tag=C:\\\\ ,integer_tag=2,string_tag=hello '
'bool_val=True,float_val=1.1,int_val=1i,string_val="hello!"\n'
)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/influxdb-5.0.0/influxdb.egg-info/PKG-INFO
new/influxdb-5.1.0/influxdb.egg-info/PKG-INFO
--- old/influxdb-5.0.0/influxdb.egg-info/PKG-INFO 2017-11-21
06:01:29.000000000 +0100
+++ new/influxdb-5.1.0/influxdb.egg-info/PKG-INFO 2018-06-27
01:17:23.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: influxdb
-Version: 5.0.0
+Version: 5.1.0
Summary: InfluxDB client
Home-page: https://github.com/influxdb/influxdb-python
Author: UNKNOWN
@@ -11,7 +11,6 @@
.. image::
https://travis-ci.org/influxdata/influxdb-python.svg?branch=master
:target: https://travis-ci.org/influxdata/influxdb-python
-
.. image::
https://readthedocs.org/projects/influxdb-python/badge/?version=latest&style
:target: http://influxdb-python.readthedocs.org/
:alt: Documentation Status
@@ -20,9 +19,13 @@
:target: https://coveralls.io/r/influxdata/influxdb-python
:alt: Coverage
+ .. image:: https://img.shields.io/pypi/v/influxdb.svg
+ :target: https://pypi.python.org/pypi/influxdb
+ :alt: PyPI Status
+ InfluxDB-Python is a client for interacting with InfluxDB_.
- InfluxDB-Python is a client for interacting with InfluxDB_.
Development of this library is maintained by
+ Development of this library is maintained by:
+-----------+-------------------------------+
| Github ID | URL |