Skip to content

Python Client doesn't check if tokens are valid or not #77

@blueelvis

Description

@blueelvis

Hi,

Just started using the Python client. If wrong credentials are passed to the client and a query is made, the client returns a wrong exception as below -

  File "D:\dev\Code\influxdb.py", line 108, in query_from_influx
    return client.query_api().query_data_frame(query=query, org=organization_id)
  File "C:\Users\bluee\AppData\Roaming\Python\Python37\site-packages\influxdb_client\client\query_api.py", line 116, in query_data_frame
    _dataFrames = list(_parser.generator())
  File "C:\Users\bluee\AppData\Roaming\Python\Python37\site-packages\influxdb_client\client\flux_csv_parser.py", line 48, in generator
    yield from parser._parse_flux_response()
  File "C:\Users\bluee\AppData\Roaming\Python\Python37\site-packages\influxdb_client\client\flux_csv_parser.py", line 87, in _parse_flux_response
    raise FluxCsvParserException("Unable to parse CSV response. FluxTable definition was not found.")
influxdb_client.client.flux_csv_parser.FluxCsvParserException: Unable to parse CSV response. FluxTable definition was not found.

Instead, I believe that while creating the client, it should check whether it is able to connect with the specified credentials instead of trying to parse the response in the query down the line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions