Skip to content

Commit f2f9a5f

Browse files
committed
Updated old api for new metadata changes
1 parent 3722e5f commit f2f9a5f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

btrdb/conn.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import json
1919
import logging
20+
import importlib.metadata
2021
import os
2122
import re
2223
import uuid as uuidlib
@@ -65,6 +66,11 @@ def __init__(self, addrportstr, apikey=None):
6566
The ``btrdb.connect`` method is a helper function to make connecting to the platform easier
6667
usually that will be sufficient for most users.
6768
"""
69+
warn(
70+
"This API is deprecated in favor of the pingthings_api, refer to your hub landing page for further documentation.",
71+
DeprecationWarning,
72+
stacklevel=2,
73+
)
6874
addrport = addrportstr.split(":", 2)
6975
# 100MB size limit ~ 2500 streams for 5000 points with each point being 64bit
7076
# 500MB size limit ~ 13K streams for 5000 points
@@ -126,6 +132,7 @@ def __init__(self, apikey, client_call_details):
126132
if client_call_details.metadata is not None:
127133
metadata = list(client_call_details.metadata)
128134
metadata.append(("authorization", "Bearer " + apikey))
135+
metadata.append(("x-api-client", "btrdbpy-" + importlib.metadata.version("btrdb")))
129136
self.method = client_call_details.method
130137
self.timeout = client_call_details.timeout
131138
self.credentials = client_call_details.credentials

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ maintainers = [
1010
description = "Bindings to interact with the Berkeley Tree Database using gRPC."
1111
readme = "README.md"
1212
license = {file="LICENSE.txt"}
13-
requires-python = ">=3.7,<=3.10"
13+
requires-python = ">=3.7,<=3.12"
1414
classifiers = [
1515
'Development Status :: 5 - Production/Stable',
1616
'Intended Audience :: Developers',

0 commit comments

Comments
 (0)