From 4465d8562f92b4c1c453ebaa943410821fedeef8 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 30 Jul 2024 16:00:43 -0700 Subject: [PATCH 1/2] Replace startsWith with startswith method The startswith method is not capitalized: https://docs.python.org/3/library/stdtypes.html#str.startswith --- .../cloud-dedicated/reference/client-libraries/v3/python.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/influxdb/cloud-dedicated/reference/client-libraries/v3/python.md b/content/influxdb/cloud-dedicated/reference/client-libraries/v3/python.md index 2fdd4e9f9..6ea1c9859 100644 --- a/content/influxdb/cloud-dedicated/reference/client-libraries/v3/python.md +++ b/content/influxdb/cloud-dedicated/reference/client-libraries/v3/python.md @@ -282,16 +282,16 @@ status = None # Define callbacks for write responses def success(self, data: str): status = "Success writing batch: data: {data}" - assert status.startsWith('Success'), f"Expected {status} to be success" + assert status.startswith('Success'), f"Expected {status} to be success" def error(self, data: str, err: InfluxDBError): status = f"Error writing batch: config: {self}, data: {data}, error: {err}" - assert status.startsWith('Success'), f"Expected {status} to be success" + assert status.startswith('Success'), f"Expected {status} to be success" def retry(self, data: str, err: InfluxDBError): status = f"Retry error writing batch: config: {self}, data: {data}, error: {err}" - assert status.startsWith('Success'), f"Expected {status} to be success" + assert status.startswith('Success'), f"Expected {status} to be success" # Instantiate WriteOptions for batching write_options = WriteOptions() From 5614600c6caaba68966a076349b78678488ad433 Mon Sep 17 00:00:00 2001 From: Jason Stirnaman Date: Wed, 31 Jul 2024 17:18:47 -0500 Subject: [PATCH 2/2] fix(5544): python str.startswith in examples - startsWith should be startswith for Python - The test should have failed; the callbacks don't seem to be working now. --- .../reference/client-libraries/v3/python.md | 6 +++--- .../clustered/reference/client-libraries/v3/python.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/content/influxdb/cloud-serverless/reference/client-libraries/v3/python.md b/content/influxdb/cloud-serverless/reference/client-libraries/v3/python.md index d0e05113d..492e8d1d9 100644 --- a/content/influxdb/cloud-serverless/reference/client-libraries/v3/python.md +++ b/content/influxdb/cloud-serverless/reference/client-libraries/v3/python.md @@ -254,16 +254,16 @@ status = None # Define callbacks for write responses def success(self, data: str): status = "Success writing batch: data: {data}" - assert status.startsWith('Success'), f"Expected {status} to be success" + assert status.startswith('Success'), f"Expected {status} to be success" def error(self, data: str, err: InfluxDBError): status = f"Error writing batch: config: {self}, data: {data}, error: {err}" - assert status.startsWith('Success'), f"Expected {status} to be success" + assert status.startswith('Success'), f"Expected {status} to be success" def retry(self, data: str, err: InfluxDBError): status = f"Retry error writing batch: config: {self}, data: {data}, error: {err}" - assert status.startsWith('Success'), f"Expected {status} to be success" + assert status.startswith('Success'), f"Expected {status} to be success" # Instantiate WriteOptions for batching write_options = WriteOptions() diff --git a/content/influxdb/clustered/reference/client-libraries/v3/python.md b/content/influxdb/clustered/reference/client-libraries/v3/python.md index 47f571a8b..dca98614a 100644 --- a/content/influxdb/clustered/reference/client-libraries/v3/python.md +++ b/content/influxdb/clustered/reference/client-libraries/v3/python.md @@ -282,16 +282,16 @@ status = None # Define callbacks for write responses def success(self, data: str): status = "Success writing batch: data: {data}" - assert status.startsWith('Success'), f"Expected {status} to be success" + assert status.startswith('Success'), f"Expected {status} to be success" def error(self, data: str, err: InfluxDBError): status = f"Error writing batch: config: {self}, data: {data}, error: {err}" - assert status.startsWith('Success'), f"Expected {status} to be success" + assert status.startswith('Success'), f"Expected {status} to be success" def retry(self, data: str, err: InfluxDBError): status = f"Retry error writing batch: config: {self}, data: {data}, error: {err}" - assert status.startsWith('Success'), f"Expected {status} to be success" + assert status.startswith('Success'), f"Expected {status} to be success" # Instantiate WriteOptions for batching write_options = WriteOptions()