Skip to content

Commit f247f23

Browse files
authored
docs: clarifying how to use an org parameter (#76)
1 parent 11b9034 commit f247f23

8 files changed

+19
-16
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## 1.6.0 [unreleased]
22

3+
### Documentation
4+
1. [#75](https://github.com/influxdata/influxdb-client-python/issues/75): Updated docs to clarify how to use an org parameter
5+
36
### Bugs
47
1. [#72](https://github.com/influxdata/influxdb-client-python/issues/72): Optimize serializing data into Pandas DataFrame
58

README.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Please follow the `Installation`_ and then run the following:
128128
129129
p = Point("my_measurement").tag("location", "Prague").field("temperature", 25.3)
130130
131-
write_api.write(bucket=bucket, org="my-org", record=p)
131+
write_api.write(bucket=bucket, record=p)
132132
133133
## using Table structure
134134
tables = query_api.query('from(bucket:"my-bucket") |> range(start: -10m)')
@@ -435,7 +435,7 @@ The API also support streaming ``FluxRecord`` via `query_stream <https://github.
435435
_point1 = Point("my_measurement").tag("location", "Prague").field("temperature", 25.3)
436436
_point2 = Point("my_measurement").tag("location", "New York").field("temperature", 24.3)
437437
438-
write_api.write(bucket="my-bucket", org="my-org", record=[_point1, _point2])
438+
write_api.write(bucket="my-bucket", record=[_point1, _point2])
439439
440440
"""
441441
Query: using Table structure
@@ -514,7 +514,7 @@ The ``client`` is able to retrieve data in `Pandas DataFrame <https://pandas.pyd
514514
_point1 = Point("my_measurement").tag("location", "Prague").field("temperature", 25.3)
515515
_point2 = Point("my_measurement").tag("location", "New York").field("temperature", 24.3)
516516
517-
write_api.write(bucket="my-bucket", org="my-org", record=[_point1, _point2])
517+
write_api.write(bucket="my-bucket", record=[_point1, _point2])
518518
519519
"""
520520
Query: using Pandas DataFrame
@@ -624,7 +624,7 @@ If you would like to import gigabytes of data then use our multiprocessing examp
624624
"""
625625
Write data into InfluxDB
626626
"""
627-
write_api.write(org="my-org", bucket="my-bucket", record=data)
627+
write_api.write(bucket="my-bucket", record=data)
628628
write_api.__del__()
629629
630630
"""
@@ -634,7 +634,7 @@ If you would like to import gigabytes of data then use our multiprocessing examp
634634
' |> range(start: 0, stop: now())' \
635635
' |> filter(fn: (r) => r._measurement == "financial-analysis")' \
636636
' |> max()'
637-
result = client.query_api().query(org="my-org", query=query)
637+
result = client.query_api().query(query=query)
638638
639639
"""
640640
Processing results
@@ -729,7 +729,7 @@ Efficiency write data from IOT sensor
729729
Create client that writes data into InfluxDB
730730
"""
731731
_write_api = _db_client.write_api(write_options=WriteOptions(batch_size=1))
732-
_write_api.write(org="my-org", bucket="my-bucket", record=data)
732+
_write_api.write(bucket="my-bucket", record=data)
733733
734734
735735
"""

examples/example.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
p = Point("my_measurement").tag("location", "Prague").field("temperature", 25.3).time(datetime.now(), WritePrecision.MS)
1515

1616
# write using point structure
17-
write_api.write(org="my-org", bucket=bucket, record=p)
17+
write_api.write(bucket=bucket, record=p)
1818

1919
line_protocol = p.to_line_protocol()
2020
print(line_protocol)
2121

2222
# write using line protocol string
23-
write_api.write(org="my-org", bucket=bucket, record=line_protocol)
23+
write_api.write(bucket=bucket, record=line_protocol)
2424

2525
# using Table structure
2626
tables = query_api.query('from(bucket:"my-bucket") |> range(start: -1m)')

examples/import_data_set.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def parse_row(row: OrderedDict):
7070
"""
7171
Write data into InfluxDB
7272
"""
73-
write_api.write(org="my-org", bucket="my-bucket", record=data)
73+
write_api.write(bucket="my-bucket", record=data)
7474
write_api.__del__()
7575

7676
"""
@@ -80,7 +80,7 @@ def parse_row(row: OrderedDict):
8080
' |> range(start: 0, stop: now())' \
8181
' |> filter(fn: (r) => r._measurement == "financial-analysis")' \
8282
' |> max()'
83-
result = client.query_api().query(org="my-org", query=query)
83+
result = client.query_api().query(query=query)
8484

8585
"""
8686
Processing results

examples/import_data_set_multiprocessing.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def run(self):
5353
self.terminate()
5454
self.queue.task_done()
5555
break
56-
self.write_api.write(org="my-org", bucket="my-bucket", record=next_task)
56+
self.write_api.write(bucket="my-bucket", record=next_task)
5757
self.queue.task_done()
5858

5959
def terminate(self) -> None:
@@ -200,7 +200,7 @@ def init_counter(counter, progress, queue):
200200
'|> drop(columns: ["_start", "_stop"])|> limit(n:10, offset: 0)'
201201

202202
client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org", debug=False)
203-
result = client.query_api().query(org="my-org", query=query)
203+
result = client.query_api().query(query=query)
204204

205205
"""
206206
Processing results

examples/iot_sensor.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def line_protocol(temperature):
6767
Create client that writes data into InfluxDB
6868
"""
6969
_write_api = _db_client.write_api(write_options=WriteOptions(batch_size=1))
70-
_write_api.write(org="my-org", bucket="my-bucket", record=data)
70+
_write_api.write(bucket="my-bucket", record=data)
7171

7272
"""
7373
Call after terminate a script

examples/query.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
_point1 = Point("my_measurement").tag("location", "Prague").field("temperature", 25.3)
1414
_point2 = Point("my_measurement").tag("location", "New York").field("temperature", 24.3)
1515

16-
write_api.write(bucket="my-bucket", org="my-org", record=[_point1, _point2])
16+
write_api.write(bucket="my-bucket", record=[_point1, _point2])
1717

1818
"""
1919
Query: using Table structure

notebooks/stock_predictions_import_data.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def main():
6060
client = InfluxDBClient(url="http://localhost:9999", token="my-token", org="my-org", debug=False)
6161
write_api = client.write_api(write_options=WriteOptions(batch_size=50_000, flush_interval=10_000))
6262

63-
write_api.write(org="my-org", bucket="my-bucket", record=data)
63+
write_api.write(bucket="my-bucket", record=data)
6464
write_api.__del__()
6565

6666
query = '''
@@ -72,7 +72,7 @@ def main():
7272
|> drop(columns: ["_start", "_stop", "table", "_field","_measurement"])
7373
'''
7474

75-
result = client.query_api().query_data_frame(org="my-org", query=query)
75+
result = client.query_api().query_data_frame(query=query)
7676
print(result.head(100))
7777

7878
"""

0 commit comments

Comments
 (0)