-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SyntaxError in examples #540
Comments
Hi @hterik, thanks for using our client. I am not able to simulate your from influxdb_client import InfluxDBClient
from influxdb_client.client.exceptions import InfluxDBError
class BatchingCallback(object):
def success(self, conf: (str, str, str), data: str):
print(f"Written batch: {conf}, data: {data}")
def error(self, conf: (str, str, str), data: str, exception: InfluxDBError):
print(f"Cannot write batch: {conf}, data: {data} due: {exception}")
def retry(self, conf: (str, str, str), data: str, exception: InfluxDBError):
print(f"Retryable error occurs for batch: {conf}, data: {data} retry: {exception}")
with InfluxDBClient(url="http://localhost:8086", token="my-token", org="my-org") as client:
callback = BatchingCallback()
with client.write_api(success_callback=callback.success,
error_callback=callback.error,
retry_callback=callback.retry) as write_api:
pass The
Can you share your python version or step-by-step guide to simulate the Regards |
Try |
@hterik thanks for this suggestion. There is a lot of code in our source base which is not complain with http://mypy-lang.org. Is this something you might be willing to help with? |
Specifications
Code sample to reproduce problem
Code example from README.rst
Expected behavior
Code from Readme can be copy-pasted into source file and not generate syntax errors from either python nor mypy.
Actual behavior
Running mypy gives error:
Additional info
Using the suggestion from mypy error message should be sufficent.
(Would be great if
tuple
alias could be used instead oftyping.Tuple
to save on import verbosity, but that requires 3.9+, this library is currently targeting 3.7+.)The text was updated successfully, but these errors were encountered: