Skip to content
Open
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
Binary file added .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/build
/dist
__pycache__/
setup.py
# setup.py

# Compiled python modules.
*.pyc
Expand Down
5 changes: 3 additions & 2 deletions pinform/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
from .utils import dromedary_to_underline, underline_to_dromedary


name = "pinform"
__name__ = "pinform"
__version__ = '0.9.2'


class MeasurementNameComponent(object):
Expand Down Expand Up @@ -255,7 +256,7 @@ def get_name(cls, name_components: Dict[str, str] = None) -> str:
if name_components is None:
raise Exception('Measurement name resolution needs a component named ' + name_tag + ' but null name components is provided')
if name_tag in name_components.keys():
measurement_name.replace('(' + name_tag + ')', name_components[name_tag])
measurement_name = measurement_name.replace('(' + name_tag + ')', name_components[name_tag])
else:
raise Exception('Tag with name ' + name_tag + ' not provided in name resolution tags for resolving dynamic measurement name')
return measurement_name
Expand Down
4 changes: 2 additions & 2 deletions pinform/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def load_points(self, measurement_type: Type[T], name_components: Optional[Dict[
time_range: Union[datetime.date, Tuple[datetime.datetime, datetime.datetime]] = None,
limit: Optional[int] = None, tz: pytz.UTC = pytz.utc) -> List[T]:
# noinspection SqlNoDataSourceInspection
query_string = "SELECT * FROM {measurement_name}".format(measurement_name=Measurement.get_name(measurement_type, name_components=name_components))
query_string = """SELECT * FROM "{measurement_name}" """.format(measurement_name=Measurement.get_name(measurement_type, name_components=name_components))

and_conditions_list = []
if tags is not None:
Expand Down Expand Up @@ -322,7 +322,7 @@ def get_fields_as_series(self, measurement: Type[T],
aggregated_field_names.append(aggregation_mode.get_result_field_name(field_name))

query_string += ', '.join(properties)
query_string += " FROM {measurement_name}".format(measurement_name=measurement_name)
query_string += """ FROM "{measurement_name}" """.format(measurement_name=measurement_name)

and_conditions_list = []
if tags is not None:
Expand Down
3 changes: 3 additions & 0 deletions pyvenv.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
home = /usr/local/bin
include-system-site-packages = false
version = 3.7.7
40 changes: 40 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
from pathlib import Path

from setuptools import setup, find_packages # noqa: H301

with open('requirements.txt', 'r') as f:
requires = [x.strip() for x in f if x.strip()]

with open('README.md', 'r') as f:
readme = f.read()


NAME = "pinform"

meta = {}
with open(Path(__file__).parent / 'pinform' / '__init__.py') as f:
exec('\n'.join(l for l in f if l.startswith('__')), meta)

setup(
name=NAME,
version=meta.get('__version__'),
description="Pinform with a minor edit.",
long_description=readme,
url="https://github.com/iDrwish/pinform",
keywords=["InfluxDB", "InfluxDB Python Client"],
install_requires=requires,
packages=find_packages(),
python_requires='>=3.6',
include_package_data=True,
data_files=['requirements.txt'],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Topic :: Database',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules',
])