🚀 Big News:Socket Has Acquired Secure Annex.Learn More
Socket
Book a DemoSign in
Socket

influxdb-client

Package Overview
Dependencies
Maintainers
4
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

influxdb-client - pypi Package Compare versions

Comparing version
1.44.0
to
1.45.0
+6
-6
influxdb_client.egg-info/PKG-INFO
Metadata-Version: 2.1
Name: influxdb-client
Version: 1.44.0
Version: 1.45.0
Summary: InfluxDB 2.0 Python client library

@@ -421,3 +421,3 @@ Home-page: https://github.com/influxdata/influxdb-client-python

``` python
from datetime import datetime, timedelta
from datetime import datetime, timedelta, timezone

@@ -486,3 +486,3 @@ import pandas as pd

"""
_now = datetime.utcnow()
_now = datetime.now(tz=timezone.utc)
_data_frame = pd.DataFrame(data=[["coyote_creek", 1.0], ["coyote_creek", 2.0]],

@@ -954,3 +954,3 @@ index=[_now, _now + timedelta(hours=1)],

from datetime import datetime
from datetime import datetime, timezone

@@ -977,3 +977,3 @@ from influxdb_client import Point, InfluxDBClient

"""
point = Point(kind).tag('host', host).tag('device', device).field('value', 25.3).time(time=datetime.utcnow())
point = Point(kind).tag('host', host).tag('device', device).field('value', 25.3).time(time=datetime.now(tz=timezone.utc))

@@ -1440,3 +1440,3 @@ print(f'Writing to InfluxDB cloud: {point.to_line_protocol()} ...')

> async with InfluxDBClientAsync(url="http://localhost:8086", token="my-token", org="my-org") as client:
> start = datetime.utcfromtimestamp(0)
> start = datetime.fromtimestamp(0)
> stop = datetime.now()

@@ -1443,0 +1443,0 @@ > # Delete data with location = 'Prague'

@@ -125,2 +125,2 @@ """Collect and async write time series data to InfluxDB Cloud or InfluxDB OSS."""

content_type="text/plain; charset=utf-8")
return response[1] == 204
return response[1] in (201, 204)

@@ -13,3 +13,3 @@ """Point data structure to represent LineProtocol."""

EPOCH = datetime.utcfromtimestamp(0).replace(tzinfo=timezone.utc)
EPOCH = datetime.fromtimestamp(0, tz=timezone.utc)

@@ -16,0 +16,0 @@ DEFAULT_WRITE_PRECISION = WritePrecision.NS

"""Version of the Client that is used in User-Agent header."""
VERSION = '1.44.0'
VERSION = '1.45.0'
Metadata-Version: 2.1
Name: influxdb_client
Version: 1.44.0
Version: 1.45.0
Summary: InfluxDB 2.0 Python client library

@@ -421,3 +421,3 @@ Home-page: https://github.com/influxdata/influxdb-client-python

``` python
from datetime import datetime, timedelta
from datetime import datetime, timedelta, timezone

@@ -486,3 +486,3 @@ import pandas as pd

"""
_now = datetime.utcnow()
_now = datetime.now(tz=timezone.utc)
_data_frame = pd.DataFrame(data=[["coyote_creek", 1.0], ["coyote_creek", 2.0]],

@@ -954,3 +954,3 @@ index=[_now, _now + timedelta(hours=1)],

from datetime import datetime
from datetime import datetime, timezone

@@ -977,3 +977,3 @@ from influxdb_client import Point, InfluxDBClient

"""
point = Point(kind).tag('host', host).tag('device', device).field('value', 25.3).time(time=datetime.utcnow())
point = Point(kind).tag('host', host).tag('device', device).field('value', 25.3).time(time=datetime.now(tz=timezone.utc))

@@ -1440,3 +1440,3 @@ print(f'Writing to InfluxDB cloud: {point.to_line_protocol()} ...')

> async with InfluxDBClientAsync(url="http://localhost:8086", token="my-token", org="my-org") as client:
> start = datetime.utcfromtimestamp(0)
> start = datetime.fromtimestamp(0)
> stop = datetime.now()

@@ -1443,0 +1443,0 @@ > # Delete data with location = 'Prague'

@@ -395,3 +395,3 @@ # influxdb-client-python

``` python
from datetime import datetime, timedelta
from datetime import datetime, timedelta, timezone

@@ -460,3 +460,3 @@ import pandas as pd

"""
_now = datetime.utcnow()
_now = datetime.now(tz=timezone.utc)
_data_frame = pd.DataFrame(data=[["coyote_creek", 1.0], ["coyote_creek", 2.0]],

@@ -928,3 +928,3 @@ index=[_now, _now + timedelta(hours=1)],

from datetime import datetime
from datetime import datetime, timezone

@@ -951,3 +951,3 @@ from influxdb_client import Point, InfluxDBClient

"""
point = Point(kind).tag('host', host).tag('device', device).field('value', 25.3).time(time=datetime.utcnow())
point = Point(kind).tag('host', host).tag('device', device).field('value', 25.3).time(time=datetime.now(tz=timezone.utc))

@@ -1414,3 +1414,3 @@ print(f'Writing to InfluxDB cloud: {point.to_line_protocol()} ...')

> async with InfluxDBClientAsync(url="http://localhost:8086", token="my-token", org="my-org") as client:
> start = datetime.utcfromtimestamp(0)
> start = datetime.fromtimestamp(0)
> stop = datetime.now()

@@ -1417,0 +1417,0 @@ > # Delete data with location = 'Prague'

@@ -5,3 +5,3 @@ import asyncio

import os
from datetime import datetime
from datetime import datetime, timezone
from io import StringIO

@@ -206,7 +206,7 @@

_point1 = Point(measurement).tag("location", "Prague").field("temperature", 25.3) \
.time(datetime.utcfromtimestamp(0), write_precision=WritePrecision.S)
.time(datetime.fromtimestamp(0, tz=timezone.utc), write_precision=WritePrecision.S)
_point2 = Point(measurement).tag("location", "New York").field("temperature", 24.3) \
.time(datetime.utcfromtimestamp(1), write_precision=WritePrecision.MS)
.time(datetime.fromtimestamp(1, tz=timezone.utc), write_precision=WritePrecision.MS)
_point3 = Point(measurement).tag("location", "Berlin").field("temperature", 24.3) \
.time(datetime.utcfromtimestamp(2), write_precision=WritePrecision.NS)
.time(datetime.fromtimestamp(2, tz=timezone.utc), write_precision=WritePrecision.NS)
await self.client.write_api().write(bucket="my-bucket", record=[_point1, _point2, _point3],

@@ -233,3 +233,4 @@ write_precision=WritePrecision.NS)

successfully = await self.client.delete_api().delete(start=datetime.utcfromtimestamp(0), stop=datetime.utcnow(),
successfully = await self.client.delete_api().delete(start=datetime.fromtimestamp(0),
stop=datetime.now(tz=timezone.utc),
predicate="location = \"Prague\"", bucket="my-bucket")

@@ -236,0 +237,0 @@ self.assertEqual(True, successfully)

import os
import unittest
from datetime import datetime
from datetime import datetime, timezone

@@ -56,3 +56,3 @@ from influxdb_client import WritePrecision, InfluxDBClient

def test_pass_parameters(self):
unique = get_date_helper().to_nanoseconds(datetime.utcnow() - datetime.utcfromtimestamp(0))
unique = get_date_helper().to_nanoseconds(datetime.now(tz=timezone.utc) - datetime.fromtimestamp(0, tz=timezone.utc))

@@ -73,2 +73,2 @@ # write data

self.assertEqual(5, record["_value"])
self.assertEqual(get_date_helper().to_utc(datetime.utcfromtimestamp(10)), record["_time"])
self.assertEqual(get_date_helper().to_utc(datetime.fromtimestamp(10, tz=timezone.utc)), record["_time"])

@@ -26,3 +26,3 @@ import unittest

date = self.helper.parse_date('2020-08-07T06:21:57.331249158Z').replace(tzinfo=timezone.utc)
nanoseconds = self.helper.to_nanoseconds(date - datetime.utcfromtimestamp(0).replace(tzinfo=timezone.utc))
nanoseconds = self.helper.to_nanoseconds(date - datetime.fromtimestamp(0, tz=timezone.utc))

@@ -29,0 +29,0 @@ self.assertEqual(nanoseconds, 1596781317331249158)