Skip to content
This repository has been archived by the owner on Oct 29, 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 1 commit
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
8 changes: 6 additions & 2 deletions influxdb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,20 @@
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',
]

if "INFLUXDB_NO_DATAFRAME_CLIENT" not in os.environ:
jdoyle93 marked this conversation as resolved.
Show resolved Hide resolved
from .dataframe_client import DataFrameClient
__all__.append( "DataFrameClient" )


__version__ = '5.3.0'