Skip to content

chore: added check to code style, added check to correct PyPI documentation #126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jul 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 33 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
parameters:
python-image:
type: string
default: "circleci/python:3.6-buster"
default: &default-python "circleci/python:3.6-buster"
influxdb-image:
type: string
default: "influxdb:2.0.0-beta"
Expand All @@ -69,24 +69,51 @@ jobs:
- run:
name: "Collecting coverage reports"
command: bash <(curl -s https://codecov.io/bash) -f ./coverage.xml || echo "Codecov did not collect coverage reports"
check-code-style:
docker:
- image: *default-python
environment:
PIPENV_VENV_IN_PROJECT: true
steps:
- checkout
- run:
name: Checks style consistency across sources.
command: |
pip install flake8 --user
flake8 influxdb_client/
check-twine:
docker:
- image: *default-python
environment:
PIPENV_VENV_IN_PROJECT: true
steps:
- checkout
- run:
name: Checks that the description will render correctly on PyPI.
command: |
pip install twine --user
python setup.py sdist bdist_wheel
twine check dist/*

workflows:
version: 2
build:
jobs:
- check-code-style
- check-twine
- tests-python:
name: python-3.6
name: test-3.6
- tests-python:
name: python-3.6-without-ciso8601
name: test-3.6-without-ciso8601
enabled-ciso-8601: false
- tests-python:
name: python-3.6-nightly
name: test-3.6-influxdb-nightly
influxdb-image: "influx:nightly"
- tests-python:
name: python-3.7
name: test-3.7
python-image: "circleci/python:3.7-buster"
- tests-python:
name: python-3.8
name: test-3.8
python-image: "circleci/python:3.8-buster"

nightly:
Expand Down
4 changes: 0 additions & 4 deletions influxdb_client/client/abstract_client.py

This file was deleted.

3 changes: 2 additions & 1 deletion influxdb_client/client/influxdb_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ def from_env_properties(cls, debug=None, enable_gzip=False):
if key.startswith("INFLUXDB_V2_TAG_"):
default_tags[key[16:].lower()] = value

return cls(url, token, debug=debug, timeout=int(timeout), org=org, default_tags=default_tags, enable_gzip=enable_gzip)
return cls(url, token, debug=debug, timeout=int(timeout), org=org, default_tags=default_tags,
enable_gzip=enable_gzip)

def write_api(self, write_options=WriteOptions(), point_settings=PointSettings()) -> WriteApi:
"""
Expand Down
15 changes: 9 additions & 6 deletions influxdb_client/client/write_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from rx.subject import Subject

from influxdb_client import WritePrecision, WriteService
from influxdb_client.client.abstract_client import AbstractClient
from influxdb_client.client.write.point import Point, DEFAULT_WRITE_PRECISION, _ESCAPE_KEY
from influxdb_client.rest import ApiException

Expand Down Expand Up @@ -119,7 +118,7 @@ def __hash__(self) -> int:

def __eq__(self, o: object) -> bool:
return isinstance(o, self.__class__) \
and self.bucket == o.bucket and self.org == o.org and self.precision == o.precision
and self.bucket == o.bucket and self.org == o.org and self.precision == o.precision

def __str__(self) -> str:
return '_BatchItemKey[bucket:\'{}\', org:\'{}\', precision:\'{}\']' \
Expand All @@ -141,7 +140,7 @@ def _body_reduce(batch_items):
return b'\n'.join(map(lambda batch_item: batch_item.data, batch_items))


class WriteApi(AbstractClient):
class WriteApi:

def __init__(self, influxdb_client, write_options: WriteOptions = WriteOptions(),
point_settings: PointSettings = PointSettings()) -> None:
Expand Down Expand Up @@ -188,9 +187,12 @@ def write(self, bucket: str, org: str = None,
"""
Writes time-series data into influxdb.

:param str org: specifies the destination organization for writes; take either the ID or Name interchangeably; if both orgID and org are specified, org takes precedence. (required)
:param str org: specifies the destination organization for writes; take either the ID or Name interchangeably;
if both orgID and org are specified, org takes precedence. (required)
:param str bucket: specifies the destination bucket for writes (required)
:param WritePrecision write_precision: specifies the precision for the unix timestamps within the body line-protocol. The precision specified on a Point has precedes and is use for write.
:param WritePrecision write_precision: specifies the precision for the unix timestamps within
the body line-protocol. The precision specified on a Point has precedes
and is use for write.
:param record: Points, line protocol, Pandas DataFrame, RxPY Observable to write
:param data_frame_measurement_name: name of measurement for writing Pandas DataFrame
:param data_frame_tag_columns: list of DataFrame columns which are tags, rest columns will be fields
Expand Down Expand Up @@ -253,7 +255,8 @@ def _serialize(self, record, write_precision, payload, **kwargs):
self._serialize(record.to_line_protocol(), record.write_precision, payload, **kwargs)

elif isinstance(record, dict):
self._serialize(Point.from_dict(record, write_precision=write_precision), write_precision, payload, **kwargs)
self._serialize(Point.from_dict(record, write_precision=write_precision),
write_precision, payload, **kwargs)
elif 'DataFrame' in type(record).__name__:
_data = self._data_frame_to_list_of_points(record, precision=write_precision, **kwargs)
self._serialize(_data, write_precision, payload, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion influxdb_client/domain/authorization.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class Authorization(AuthorizationUpdateRequest):

def __init__(self, created_at=None, updated_at=None, org_id=None, permissions=None, id=None, token=None, user_id=None, user=None, org=None, links=None, status='active', description=None): # noqa: E501
"""Authorization - a model defined in OpenAPI""" # noqa: E501
AuthorizationUpdateRequest.__init__(self, status=status, description=description)
AuthorizationUpdateRequest.__init__(self, status=status, description=description) # noqa: E501

self._created_at = None
self._updated_at = None
Expand Down
2 changes: 1 addition & 1 deletion influxdb_client/domain/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class Check(CheckBase):

def __init__(self, id=None, name=None, org_id=None, owner_id=None, created_at=None, updated_at=None, query=None, status=None, every=None, offset=None, tags=None, description=None, status_message_template=None, labels=None, links=None): # noqa: E501
"""Check - a model defined in OpenAPI""" # noqa: E501
CheckBase.__init__(self, id=id, name=name, org_id=org_id, owner_id=owner_id, created_at=created_at, updated_at=updated_at, query=query, status=status, every=every, offset=offset, tags=tags, description=description, status_message_template=status_message_template, labels=labels, links=links)
CheckBase.__init__(self, id=id, name=name, org_id=org_id, owner_id=owner_id, created_at=created_at, updated_at=updated_at, query=query, status=status, every=every, offset=offset, tags=tags, description=description, status_message_template=status_message_template, labels=labels, links=links) # noqa: E501
self.discriminator = None

def to_dict(self):
Expand Down
2 changes: 1 addition & 1 deletion influxdb_client/domain/check_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class CheckBase(CheckDiscriminator):

def __init__(self, id=None, name=None, org_id=None, owner_id=None, created_at=None, updated_at=None, query=None, status=None, every=None, offset=None, tags=None, description=None, status_message_template=None, labels=None, links=None): # noqa: E501
"""CheckBase - a model defined in OpenAPI""" # noqa: E501
CheckDiscriminator.__init__(self)
CheckDiscriminator.__init__(self) # noqa: E501

self._id = None
self._name = None
Expand Down
2 changes: 1 addition & 1 deletion influxdb_client/domain/check_discriminator.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class CheckDiscriminator(PostCheck):

def __init__(self): # noqa: E501
"""CheckDiscriminator - a model defined in OpenAPI""" # noqa: E501
PostCheck.__init__(self)
PostCheck.__init__(self) # noqa: E501
self.discriminator = 'type'

def get_real_child_model(self, data):
Expand Down
2 changes: 1 addition & 1 deletion influxdb_client/domain/check_view_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class CheckViewProperties(ViewProperties):

def __init__(self, type=None, shape=None, check_id=None, check=None, queries=None, colors=None): # noqa: E501
"""CheckViewProperties - a model defined in OpenAPI""" # noqa: E501
ViewProperties.__init__(self)
ViewProperties.__init__(self) # noqa: E501

self._type = None
self._shape = None
Expand Down
2 changes: 1 addition & 1 deletion influxdb_client/domain/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Dashboard(CreateDashboardRequest):

def __init__(self, links=None, id=None, meta=None, cells=None, labels=None, org_id=None, name=None, description=None): # noqa: E501
"""Dashboard - a model defined in OpenAPI""" # noqa: E501
CreateDashboardRequest.__init__(self, org_id=org_id, name=name, description=description)
CreateDashboardRequest.__init__(self, org_id=org_id, name=name, description=description) # noqa: E501

self._links = None
self._id = None
Expand Down
2 changes: 1 addition & 1 deletion influxdb_client/domain/deadman_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class DeadmanCheck(Check):

def __init__(self, type=None, time_since=None, stale_time=None, report_zero=None, level=None): # noqa: E501
"""DeadmanCheck - a model defined in OpenAPI""" # noqa: E501
Check.__init__(self)
Check.__init__(self) # noqa: E501

self._type = None
self._time_since = None
Expand Down
2 changes: 1 addition & 1 deletion influxdb_client/domain/gauge_view_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class GaugeViewProperties(ViewProperties):

def __init__(self, type=None, queries=None, colors=None, shape=None, note=None, show_note_when_empty=None, prefix=None, tick_prefix=None, suffix=None, tick_suffix=None, legend=None, decimal_places=None): # noqa: E501
"""GaugeViewProperties - a model defined in OpenAPI""" # noqa: E501
ViewProperties.__init__(self)
ViewProperties.__init__(self) # noqa: E501

self._type = None
self._queries = None
Expand Down
16 changes: 6 additions & 10 deletions influxdb_client/domain/greater_threshold.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
import re # noqa: F401

import six
from influxdb_client.domain.threshold_base import ThresholdBase
from influxdb_client.domain.threshold import Threshold


class GreaterThreshold(ThresholdBase):
class GreaterThreshold(Threshold):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech

Expand All @@ -33,21 +33,17 @@ class GreaterThreshold(ThresholdBase):
"""
openapi_types = {
'type': 'str',
'value': 'float',
'level': 'CheckStatusLevel',
'all_values': 'bool'
'value': 'float'
}

attribute_map = {
'type': 'type',
'value': 'value',
'level': 'level',
'all_values': 'allValues'
'value': 'value'
}

def __init__(self, type=None, value=None, level=None, all_values=None): # noqa: E501
def __init__(self, type=None, value=None): # noqa: E501
"""GreaterThreshold - a model defined in OpenAPI""" # noqa: E501
ThresholdBase.__init__(self, level=level, all_values=all_values)
Threshold.__init__(self) # noqa: E501

self._type = None
self._value = None
Expand Down
2 changes: 1 addition & 1 deletion influxdb_client/domain/heatmap_view_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class HeatmapViewProperties(ViewProperties):

def __init__(self, time_format=None, type=None, queries=None, colors=None, shape=None, note=None, show_note_when_empty=None, x_column=None, y_column=None, x_domain=None, y_domain=None, x_axis_label=None, y_axis_label=None, x_prefix=None, x_suffix=None, y_prefix=None, y_suffix=None, bin_size=None): # noqa: E501
"""HeatmapViewProperties - a model defined in OpenAPI""" # noqa: E501
ViewProperties.__init__(self)
ViewProperties.__init__(self) # noqa: E501

self._time_format = None
self._type = None
Expand Down
2 changes: 1 addition & 1 deletion influxdb_client/domain/histogram_view_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class HistogramViewProperties(ViewProperties):

def __init__(self, type=None, queries=None, colors=None, shape=None, note=None, show_note_when_empty=None, x_column=None, fill_columns=None, x_domain=None, x_axis_label=None, position=None, bin_count=None): # noqa: E501
"""HistogramViewProperties - a model defined in OpenAPI""" # noqa: E501
ViewProperties.__init__(self)
ViewProperties.__init__(self) # noqa: E501

self._type = None
self._queries = None
Expand Down
2 changes: 1 addition & 1 deletion influxdb_client/domain/http_notification_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class HTTPNotificationEndpoint(NotificationEndpoint):

def __init__(self, url=None, username=None, password=None, token=None, method=None, auth_method=None, content_template=None, headers=None): # noqa: E501
"""HTTPNotificationEndpoint - a model defined in OpenAPI""" # noqa: E501
NotificationEndpoint.__init__(self)
NotificationEndpoint.__init__(self) # noqa: E501

self._url = None
self._username = None
Expand Down
2 changes: 1 addition & 1 deletion influxdb_client/domain/http_notification_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class HTTPNotificationRule(HTTPNotificationRuleBase):

def __init__(self, type=None, url=None): # noqa: E501
"""HTTPNotificationRule - a model defined in OpenAPI""" # noqa: E501
HTTPNotificationRuleBase.__init__(self, type=type, url=url)
HTTPNotificationRuleBase.__init__(self, type=type, url=url) # noqa: E501
self.discriminator = None

def to_dict(self):
Expand Down
16 changes: 6 additions & 10 deletions influxdb_client/domain/lesser_threshold.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
import re # noqa: F401

import six
from influxdb_client.domain.threshold_base import ThresholdBase
from influxdb_client.domain.threshold import Threshold


class LesserThreshold(ThresholdBase):
class LesserThreshold(Threshold):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech

Expand All @@ -33,21 +33,17 @@ class LesserThreshold(ThresholdBase):
"""
openapi_types = {
'type': 'str',
'value': 'float',
'level': 'CheckStatusLevel',
'all_values': 'bool'
'value': 'float'
}

attribute_map = {
'type': 'type',
'value': 'value',
'level': 'level',
'all_values': 'allValues'
'value': 'value'
}

def __init__(self, type=None, value=None, level=None, all_values=None): # noqa: E501
def __init__(self, type=None, value=None): # noqa: E501
"""LesserThreshold - a model defined in OpenAPI""" # noqa: E501
ThresholdBase.__init__(self, level=level, all_values=all_values)
Threshold.__init__(self) # noqa: E501

self._type = None
self._value = None
Expand Down
2 changes: 1 addition & 1 deletion influxdb_client/domain/markdown_view_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class MarkdownViewProperties(ViewProperties):

def __init__(self, type=None, shape=None, note=None): # noqa: E501
"""MarkdownViewProperties - a model defined in OpenAPI""" # noqa: E501
ViewProperties.__init__(self)
ViewProperties.__init__(self) # noqa: E501

self._type = None
self._shape = None
Expand Down
2 changes: 1 addition & 1 deletion influxdb_client/domain/notification_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class NotificationEndpoint(NotificationEndpointBase):

def __init__(self, id=None, org_id=None, user_id=None, created_at=None, updated_at=None, description=None, name=None, status='active', labels=None, links=None, type=None): # noqa: E501
"""NotificationEndpoint - a model defined in OpenAPI""" # noqa: E501
NotificationEndpointBase.__init__(self, id=id, org_id=org_id, user_id=user_id, created_at=created_at, updated_at=updated_at, description=description, name=name, status=status, labels=labels, links=links, type=type)
NotificationEndpointBase.__init__(self, id=id, org_id=org_id, user_id=user_id, created_at=created_at, updated_at=updated_at, description=description, name=name, status=status, labels=labels, links=links, type=type) # noqa: E501
self.discriminator = None

def to_dict(self):
Expand Down
2 changes: 1 addition & 1 deletion influxdb_client/domain/notification_endpoint_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class NotificationEndpointBase(NotificationEndpointDiscriminator):

def __init__(self, id=None, org_id=None, user_id=None, created_at=None, updated_at=None, description=None, name=None, status='active', labels=None, links=None, type=None): # noqa: E501
"""NotificationEndpointBase - a model defined in OpenAPI""" # noqa: E501
NotificationEndpointDiscriminator.__init__(self)
NotificationEndpointDiscriminator.__init__(self) # noqa: E501

self._id = None
self._org_id = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class NotificationEndpointDiscriminator(PostNotificationEndpoint):

def __init__(self): # noqa: E501
"""NotificationEndpointDiscriminator - a model defined in OpenAPI""" # noqa: E501
PostNotificationEndpoint.__init__(self)
PostNotificationEndpoint.__init__(self) # noqa: E501
self.discriminator = 'type'

def get_real_child_model(self, data):
Expand Down
2 changes: 1 addition & 1 deletion influxdb_client/domain/notification_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class NotificationRule(NotificationRuleBase):

def __init__(self, id=None, endpoint_id=None, org_id=None, owner_id=None, created_at=None, updated_at=None, status=None, name=None, sleep_until=None, every=None, offset=None, runbook_link=None, limit_every=None, limit=None, tag_rules=None, description=None, status_rules=None, labels=None, links=None): # noqa: E501
"""NotificationRule - a model defined in OpenAPI""" # noqa: E501
NotificationRuleBase.__init__(self, id=id, endpoint_id=endpoint_id, org_id=org_id, owner_id=owner_id, created_at=created_at, updated_at=updated_at, status=status, name=name, sleep_until=sleep_until, every=every, offset=offset, runbook_link=runbook_link, limit_every=limit_every, limit=limit, tag_rules=tag_rules, description=description, status_rules=status_rules, labels=labels, links=links)
NotificationRuleBase.__init__(self, id=id, endpoint_id=endpoint_id, org_id=org_id, owner_id=owner_id, created_at=created_at, updated_at=updated_at, status=status, name=name, sleep_until=sleep_until, every=every, offset=offset, runbook_link=runbook_link, limit_every=limit_every, limit=limit, tag_rules=tag_rules, description=description, status_rules=status_rules, labels=labels, links=links) # noqa: E501
self.discriminator = None

def to_dict(self):
Expand Down
2 changes: 1 addition & 1 deletion influxdb_client/domain/notification_rule_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class NotificationRuleBase(PostNotificationRule):

def __init__(self, id=None, endpoint_id=None, org_id=None, owner_id=None, created_at=None, updated_at=None, status=None, name=None, sleep_until=None, every=None, offset=None, runbook_link=None, limit_every=None, limit=None, tag_rules=None, description=None, status_rules=None, labels=None, links=None): # noqa: E501
"""NotificationRuleBase - a model defined in OpenAPI""" # noqa: E501
PostNotificationRule.__init__(self)
PostNotificationRule.__init__(self) # noqa: E501

self._id = None
self._endpoint_id = None
Expand Down
2 changes: 1 addition & 1 deletion influxdb_client/domain/pager_duty_notification_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class PagerDutyNotificationEndpoint(NotificationEndpoint):

def __init__(self, client_url=None, routing_key=None): # noqa: E501
"""PagerDutyNotificationEndpoint - a model defined in OpenAPI""" # noqa: E501
NotificationEndpoint.__init__(self)
NotificationEndpoint.__init__(self) # noqa: E501

self._client_url = None
self._routing_key = None
Expand Down
2 changes: 1 addition & 1 deletion influxdb_client/domain/pager_duty_notification_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class PagerDutyNotificationRule(PagerDutyNotificationRuleBase):

def __init__(self, type=None, message_template=None): # noqa: E501
"""PagerDutyNotificationRule - a model defined in OpenAPI""" # noqa: E501
PagerDutyNotificationRuleBase.__init__(self, type=type, message_template=message_template)
PagerDutyNotificationRuleBase.__init__(self, type=type, message_template=message_template) # noqa: E501
self.discriminator = None

def to_dict(self):
Expand Down
2 changes: 1 addition & 1 deletion influxdb_client/domain/post_notification_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class PostNotificationRule(NotificationRuleDiscriminator):

def __init__(self): # noqa: E501
"""PostNotificationRule - a model defined in OpenAPI""" # noqa: E501
NotificationRuleDiscriminator.__init__(self)
NotificationRuleDiscriminator.__init__(self) # noqa: E501
self.discriminator = None

def to_dict(self):
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy