Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

Using InfluxDBClient object in context manager #905

Open

Description

@sebbleroni

I recently started using influxdb and I am struggeling to use a InfluxDBClient() object as a context manager as mentioned in the documentation (https://influxdb-python.readthedocs.io/en/latest/api-documentation.html#influxdbclient). As a minimal working example I tried

with InfluxDBClient() as client:
    print(client)

which returned None.

This behaviour can most likely be explained by the lack of the InfluxDBClient.__enter__() function in the version 5.3.1 I got from pip. Is there a reason why this addition of this function is not (yet) reflected in the pip version? If not, is it safe to install the version that is currently on the master branch?

Very kind regards and many thanks for the development of this amazing package!


  • InfluxDB version: 1.8.10
  • InfluxDB-python version: 5.3.1
  • Python version: 3.8.10
  • Operating system version: Ubuntu 20.04

Activity

  1. yabberyabber commented on Nov 23, 2021

    @yabberyabber

    It looks like the 5.3.1 tag has gone missing. Unsure why or how. However, if you look at the latest code in the master branch you will see that there is now an __enter__ and an __exit__. Hopefully soon the authors can create a 5.3.2 tag which includes that.

    def __enter__(self):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions