8000 fixed pandas import · InfluxCommunity/influxdb3-python@a425d53 · GitHub
[go: up one dir, main page]

Skip to content

Commit a425d53

Browse files
author
Jay Clifford
committed
fixed pandas import
1 parent 43a7340 commit a425d53

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

Examples/pokemon-trainer/basic-write.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
from influxdb_client_3 import InfluxDBClient3, Point
2-
import pandas as pd
3-
import numpy as np
42
import datetime
53

64

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727

2828
## Dependencies
2929

30-
- `pyarrow`
31-
- `influxdb-client`
30+
- `pyarrow` (automatically installed)
31+
- `influxdb-client` (automatically installed)
32+
- `pandas` (optional)
3233

33-
*These are installed as part of the package*
3434

3535
## Installation
3636

@@ -40,9 +40,13 @@ You can install 'influxdb3-python' using `pip`:
4040
pip install influxdb3-python
4141
```
4242

43+
Note: This does not include Pandas support. If you would like to use key features such as `to_pandas()` and `write_file()` you will need to install `pandas` separately.
44+
4345
*Note: Please make sure you are using 3.6 or above. For the best performance use 3.11+*
4446

4547
# Usage
48+
One of the easiest ways to get started is to checkout the ["Pokemon-Trainer cookbook"](Examples/pokemon-trainer/cookbook.ipynb). This scenario takes you through the basics of both the client library and Pyarrow.
49+
4650
## Importing the Module
4751
```python
4852
from influxdb_client_3 import InfluxDBClient3, Point

influxdb_client_3/read_file.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
import pyarrow.csv as csv
33
import pyarrow.feather as feather
44
import pyarrow.parquet as parquet
5-
import pandas as pd
5+
6+
7+
68

79
# Check if the OS is not Windows
810
if os.name != 'nt':
@@ -21,6 +23,11 @@ def __init__(self, file, file_parser_options=None):
2123
:type file: str
2224
:param kwargs: Additional arguments for file loading functions.
2325
"""
26+
try:
27+
import pandas as pd
28+
except ImportError:
29+
raise ImportError("Pandas is required for write_file(). Please install it using 'pip install pandas' or 'pip install influxdb3-python[pandas]'")
30+
2431
self._file = file
2532
self._kwargs = file_parser_options if file_parser_options is not None else {}
2633

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def get_version():
3636
author_email='contact@influxdata.com',
3737
url='https://github.com/InfluxCommunity/influxdb3-python',
3838
packages=['influxdb_client_3'],
39+
extras_require={'pandas': ['pandas']},
3940
install_requires=['pyarrow','influxdb-client'],
4041
classifiers=[
4142
'Development Status :: 4 - Beta',

0 commit comments

Comments
 (0)
0