diff --git a/CHANGELOG.md b/CHANGELOG.md index 770386b..89f4298 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ + +# 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` diff --git a/Examples/batching_example.py b/Examples/batching_example.py index 05490d3..4cef29b 100644 --- a/Examples/batching_example.py +++ b/Examples/batching_example.py @@ -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 diff --git a/Examples/community/custom_url.py b/Examples/community/custom_url.py index 7150f72..4652115 100644 --- a/Examples/community/custom_url.py +++ b/Examples/community/custom_url.py @@ -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( diff --git a/Examples/community/database_transfer.py b/Examples/community/database_transfer.py index c93fc84..b001a0d 100644 --- a/Examples/community/database_transfer.py +++ b/Examples/community/database_transfer.py @@ -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 diff --git a/Examples/file-import/csv_write.py b/Examples/file-import/csv_write.py index 91bc389..fc80c5e 100644 --- a/Examples/file-import/csv_write.py +++ b/Examples/file-import/csv_write.py @@ -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( diff --git a/Examples/file-import/feather_write.py b/Examples/file-import/feather_write.py index aec7b47..0e5c4a6 100644 --- a/Examples/file-import/feather_write.py +++ b/Examples/file-import/feather_write.py @@ -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( diff --git a/Examples/file-import/json_write.py b/Examples/file-import/json_write.py index dc1f3f4..7129e47 100644 --- a/Examples/file-import/json_write.py +++ b/Examples/file-import/json_write.py @@ -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( diff --git a/Examples/file-import/orc_write.py b/Examples/file-import/orc_write.py index 07467dd..9ce7b38 100644 --- a/Examples/file-import/orc_write.py +++ b/Examples/file-import/orc_write.py @@ -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( diff --git a/Examples/file-import/parquet_write.py b/Examples/file-import/parquet_write.py index 544850b..e6e00ae 100644 --- a/Examples/file-import/parquet_write.py +++ b/Examples/file-import/parquet_write.py @@ -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( diff --git a/Examples/file-import/write_file_parse_options.py b/Examples/file-import/write_file_parse_options.py index f35269d..cb1ec37 100644 --- a/Examples/file-import/write_file_parse_options.py +++ b/Examples/file-import/write_file_parse_options.py @@ -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( diff --git a/Examples/pokemon-trainer/cookbook.ipynb b/Examples/pokemon-trainer/cookbook.ipynb index b009f09..7af0fe9 100644 --- a/Examples/pokemon-trainer/cookbook.ipynb +++ b/Examples/pokemon-trainer/cookbook.ipynb @@ -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" @@ -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", " )" ] }, @@ -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", @@ -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", @@ -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", diff --git a/Examples/pokemon-trainer/write-batching-flight-calloptions.py b/Examples/pokemon-trainer/write-batching-flight-calloptions.py index 25fca40..f8f8bb0 100644 --- a/Examples/pokemon-trainer/write-batching-flight-calloptions.py +++ b/Examples/pokemon-trainer/write-batching-flight-calloptions.py @@ -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( diff --git a/Examples/pokemon-trainer/write-batching.py b/Examples/pokemon-trainer/write-batching.py index e24310a..7891fe5 100644 --- a/Examples/pokemon-trainer/write-batching.py +++ b/Examples/pokemon-trainer/write-batching.py @@ -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( diff --git a/README.md b/README.md index 2e57595..ffaa9f6 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ - `pyarrow` (automatically installed) - `pandas` (optional) - + ## Installation @@ -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( @@ -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' ) - + ``` @@ -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 @@ -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.