Skip to content
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<!-- markdownlint-disable MD024 -->
# Change Log

## 0.5.0 [unreleased]

### Bugfix

- [#87](https://github.com/InfluxCommunity/influxdb3-python/pull/87): Fix examples to use `write_options` instead of the object name `WriteOptions`

### Others

- [#84](https://github.com/InfluxCommunity/influxdb3-python/pull/84): Enable packaging type information - `py.typed`
Expand Down
2 changes: 1 addition & 1 deletion Examples/batching_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def retry(self, conf, data: str, exception: InfluxDBError):
wco = write_client_options(success_callback=callback.success,
error_callback=callback.error,
retry_callback=callback.retry,
WriteOptions=write_options
write_options=write_options
)
# Opening InfluxDB client with a batch size of 5k points or flush interval
# of 10k ms and gzip compression
Expand Down
2 changes: 1 addition & 1 deletion Examples/community/custom_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def retry(self, conf, data: str, exception: InfluxDBError):
wco = write_client_options(success_callback=callback.success,
error_callback=callback.error,
retry_callback=callback.retry,
WriteOptions=write_options
write_options=write_options
)

client = InfluxDBClient3(
Expand Down
2 changes: 1 addition & 1 deletion Examples/community/database_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def retry(self, conf, data: str, exception: InfluxDBError):
wco = write_client_options(success_callback=callback.success,
error_callback=callback.error,
retry_callback=callback.retry,
WriteOptions=write_options
write_options=write_options
)
# Opening InfluxDB client with a batch size of 5k points or flush interval
# of 10k ms and gzip compression
Expand Down
2 changes: 1 addition & 1 deletion Examples/file-import/csv_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def retry(self, conf, data: str, exception: InfluxDBError):
wco = write_client_options(success_callback=callback.success,
error_callback=callback.error,
retry_callback=callback.retry,
WriteOptions=write_options
write_options=write_options
)

with InfluxDBClient3.InfluxDBClient3(
Expand Down
2 changes: 1 addition & 1 deletion Examples/file-import/feather_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def retry(self, conf, data: str, exception: InfluxDBError):
wco = write_client_options(success_callback=callback.success,
error_callback=callback.error,
retry_callback=callback.retry,
WriteOptions=write_options
write_options=write_options
)

with InfluxDBClient3.InfluxDBClient3(
Expand Down
2 changes: 1 addition & 1 deletion Examples/file-import/json_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def retry(self, conf, data: str, exception: InfluxDBError):
wco = write_client_options(success_callback=callback.success,
error_callback=callback.error,
retry_callback=callback.retry,
WriteOptions=write_options
write_options=write_options
)

with InfluxDBClient3.InfluxDBClient3(
Expand Down
2 changes: 1 addition & 1 deletion Examples/file-import/orc_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def retry(self, conf, data: str, exception: InfluxDBError):
wco = write_client_options(success_callback=callback.success,
error_callback=callback.error,
retry_callback=callback.retry,
WriteOptions=write_options
write_options=write_options
)

with InfluxDBClient3.InfluxDBClient3(
Expand Down
2 changes: 1 addition & 1 deletion Examples/file-import/parquet_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def retry(self, conf, data: str, exception: InfluxDBError):
wco = write_client_options(success_callback=callback.success,
error_callback=callback.error,
retry_callback=callback.retry,
WriteOptions=write_options
write_options=write_options
)

with InfluxDBClient3.InfluxDBClient3(
Expand Down
2 changes: 1 addition & 1 deletion Examples/file-import/write_file_parse_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def retry(self, conf, data: str, exception: InfluxDBError):
wco = write_client_options(success_callback=callback.success,
error_callback=callback.error,
retry_callback=callback.retry,
WriteOptions=write_options
write_options=write_options
)

with InfluxDBClient3.InfluxDBClient3(
Expand Down
10 changes: 5 additions & 5 deletions Examples/pokemon-trainer/cookbook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"outputs": [],
"source": [
"\n",
"# Here we include all the imports required from influxdb_client_3 \n",
"# Here we include all the imports required from influxdb_client_3\n",
"from influxdb_client_3 import InfluxDBClient3, InfluxDBError, WriteOptions, write_client_options\n",
"import pandas as pd\n",
"import random"
Expand Down Expand Up @@ -75,7 +75,7 @@
"wco = write_client_options(success_callback=callback.success,\n",
" error_callback=callback.error,\n",
" retry_callback=callback.retry,\n",
" WriteOptions=write_options \n",
" write_options=write_options\n",
" )"
]
},
Expand Down Expand Up @@ -655,7 +655,7 @@
"query = '''SHOW COLUMNS FROM caught'''\n",
"\n",
"# We can use the query method to run a query against the database.\n",
"# Under the hood this creates a flight ticket and uses the FlightClient to run the query. \n",
"# Under the hood this creates a flight ticket and uses the FlightClient to run the query.\n",
"# For this example we are using the pandas mode, which will return a pandas DataFrame.\n",
"# Language also allows us to specify the query language, in this case we are using SQL.\n",
"table = client.query(query=query, language='sql', mode='pandas')\n",
Expand Down Expand Up @@ -1702,7 +1702,7 @@
"query = '''SELECT count(\"name\") FROM caught WHERE time > now() - 1h GROUP BY trainer'''\n",
"\n",
"# We can use the query method to run a query against the database.\n",
"# Under the hood this creates a flight ticket and uses the FlightClient to run the query. \n",
"# Under the hood this creates a flight ticket and uses the FlightClient to run the query.\n",
"# For this example we are using the pandas mode, which will return a pandas DataFrame.\n",
"# Language also allows us to specify the query language, in this case we are using SQL.\n",
"table = client.query(query=query, language='influxql', mode='pandas')\n",
Expand Down Expand Up @@ -3104,7 +3104,7 @@
"query = '''SELECT count(\"name\") FROM caught WHERE time > now() - 1h GROUP BY trainer,type1'''\n",
"\n",
"# We can use the query method to run a query against the database.\n",
"# Under the hood this creates a flight ticket and uses the FlightClient to run the query. \n",
"# Under the hood this creates a flight ticket and uses the FlightClient to run the query.\n",
"# For this example we are using the pandas mode, which will return a pandas DataFrame.\n",
"# Language also allows us to specify the query language, in this case we are using SQL.\n",
"table = client.query(query=query, language='influxql' , mode='pandas')\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def retry(self, conf, data: str, exception: InfluxDBError):
wco = write_client_options(success_callback=callback.success,
error_callback=callback.error,
retry_callback=callback.retry,
WriteOptions=write_options
write_options=write_options
)

client = InfluxDBClient3(
Expand Down
2 changes: 1 addition & 1 deletion Examples/pokemon-trainer/write-batching.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def retry(self, conf, data: str, exception: InfluxDBError):
wco = write_client_options(success_callback=callback.success,
error_callback=callback.error,
retry_callback=callback.retry,
WriteOptions=write_options
write_options=write_options
)

client = InfluxDBClient3(
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

- `pyarrow` (automatically installed)
- `pandas` (optional)


## Installation

Expand Down Expand Up @@ -113,7 +113,7 @@ write_options = WriteOptions(batch_size=500,
wco = write_client_options(success_callback=callback.success,
error_callback=callback.error,
retry_callback=callback.retry,
WriteOptions=write_options
write_options=write_options
)

with InfluxDBClient3.InfluxDBClient3(
Expand All @@ -126,11 +126,11 @@ with InfluxDBClient3.InfluxDBClient3(
client.write_file(
file='./out.csv',
timestamp_column='time', tag_columns=["provider", "machineID"])

client.write_file(
file='./out.json',
timestamp_column='time', tag_columns=["provider", "machineID"], date_unit='ns' )


```

Expand All @@ -144,7 +144,7 @@ client._write_api.write(bucket="pokemon-codex", record=pd_df, data_frame_measure
client._write_api.write(bucket="pokemon-codex", record=pl_df, data_frame_measurement_name='caught', data_frame_tag_columns=['trainer', 'id', 'num'], data_frame_timestamp_column='timestamp')
```

## Querying
## Querying

### Querying with SQL
```python
Expand Down Expand Up @@ -196,4 +196,4 @@ table = client.query(

print(table.to_pandas())
```
You may also include your own root certificate via this manor aswell.
You may also include your own root certificate via this manor aswell.