Skip to content
This repository has been archived by the owner on Jul 26, 2024. It is now read-only.

Allow skipping DataFrameClient import #850

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
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
4 changes: 4 additions & 0 deletions docs/source/api-documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ To connect to a InfluxDB, you must create a
connects to InfluxDB on ``localhost`` with the default
ports. The below instantiation statements are all equivalent::

# Set INFLUXDB_NO_DATAFRAME_CLIENT to skip the expensive DataFrameClient
# import in cases where you only need the basic InfluxDBClient.
os.environ["INFLUXDB_NO_DATAFRAME_CLIENT"] = "1"

from influxdb import InfluxDBClient

# using Http
Expand Down
2 changes: 2 additions & 0 deletions examples/tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import argparse

import os
os.environ["INFLUXDB_NO_DATAFRAME_CLIENT"] = "1"
from influxdb import InfluxDBClient


Expand Down
9 changes: 7 additions & 2 deletions influxdb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,21 @@
from __future__ import print_function
from __future__ import unicode_literals

import os

from .client import InfluxDBClient
from .dataframe_client import DataFrameClient
from .helper import SeriesHelper


__all__ = [
'InfluxDBClient',
'DataFrameClient',
'SeriesHelper',
]

NO_DATAFRAME_CLIENT = os.environ.get("INFLUXDB_NO_DATAFRAME_CLIENT", "0")
if NO_DATAFRAME_CLIENT.lower() not in ("1", "true"):
from .dataframe_client import DataFrameClient # noqa: F401 unused import
__all__.append("DataFrameClient")


__version__ = '5.3.0'