From e59653e76be7149e08be3af1e2e0a854bd90062f Mon Sep 17 00:00:00 2001 From: Gabe Fierro Date: Wed, 5 May 2021 11:30:01 -0700 Subject: [PATCH 01/29] add assertion to check for initialization, use ray 1.2.0 register_serializer --- btrdb/utils/ray.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/btrdb/utils/ray.py b/btrdb/utils/ray.py index 8df9527..d6e00e0 100644 --- a/btrdb/utils/ray.py +++ b/btrdb/utils/ray.py @@ -22,7 +22,8 @@ def register_serializer(conn_str=None, apikey=None, profile=None): found in the user's predictive grid credentials file `~/.predictivegrid/credentials.yaml`. """ - ray.register_custom_serializer( + assert ray.is_initialized(), "Need to call ray.init() before registering custom serializer" + ray.util.register_serializer( BTrDB, serializer=btrdb_serializer, deserializer=partial(btrdb_deserializer, conn_str=conn_str, apikey=apikey, profile=profile)) def btrdb_serializer(_): From 2fbff728ad45daa4d539f1ec3797543d5bdbeaec Mon Sep 17 00:00:00 2001 From: Gabe Fierro Date: Wed, 5 May 2021 11:34:19 -0700 Subject: [PATCH 02/29] is this check being run? --- btrdb/utils/ray.py | 1 + 1 file changed, 1 insertion(+) diff --git a/btrdb/utils/ray.py b/btrdb/utils/ray.py index d6e00e0..9b1f611 100644 --- a/btrdb/utils/ray.py +++ b/btrdb/utils/ray.py @@ -22,6 +22,7 @@ def register_serializer(conn_str=None, apikey=None, profile=None): found in the user's predictive grid credentials file `~/.predictivegrid/credentials.yaml`. """ + print("check init", ray.is_initialized()) assert ray.is_initialized(), "Need to call ray.init() before registering custom serializer" ray.util.register_serializer( BTrDB, serializer=btrdb_serializer, deserializer=partial(btrdb_deserializer, conn_str=conn_str, apikey=apikey, profile=profile)) From bbaa1696a6ef1566855db70327032f5540df5154 Mon Sep 17 00:00:00 2001 From: Gabe Fierro Date: Wed, 5 May 2021 11:41:17 -0700 Subject: [PATCH 03/29] remove print --- btrdb/utils/ray.py | 1 - 1 file changed, 1 deletion(-) diff --git a/btrdb/utils/ray.py b/btrdb/utils/ray.py index 9b1f611..d6e00e0 100644 --- a/btrdb/utils/ray.py +++ b/btrdb/utils/ray.py @@ -22,7 +22,6 @@ def register_serializer(conn_str=None, apikey=None, profile=None): found in the user's predictive grid credentials file `~/.predictivegrid/credentials.yaml`. """ - print("check init", ray.is_initialized()) assert ray.is_initialized(), "Need to call ray.init() before registering custom serializer" ray.util.register_serializer( BTrDB, serializer=btrdb_serializer, deserializer=partial(btrdb_deserializer, conn_str=conn_str, apikey=apikey, profile=profile)) From e2bb4f91b5581c299c90dde2a52b5e4853d760d0 Mon Sep 17 00:00:00 2001 From: Gabe Fierro Date: Thu, 20 May 2021 12:20:49 -0700 Subject: [PATCH 04/29] trying out custom serialize with a flag on connect --- btrdb/__init__.py | 15 ++++++++++++++- btrdb/utils/ray.py | 10 ++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/btrdb/__init__.py b/btrdb/__init__.py index a7019c7..b5485a5 100644 --- a/btrdb/__init__.py +++ b/btrdb/__init__.py @@ -21,6 +21,8 @@ from btrdb.version import get_version from btrdb.utils.credentials import credentials_by_profile, credentials from btrdb.stream import MINIMUM_TIME, MAXIMUM_TIME +from btrdb.util import register_serializer +from warnings import warn ########################################################################## ## Module Variables @@ -40,7 +42,7 @@ def _connect(endpoints=None, apikey=None): return BTrDB(Endpoint(Connection(endpoints, apikey=apikey).channel)) -def connect(conn_str=None, apikey=None, profile=None): +def connect(conn_str=None, apikey=None, profile=None, shareable=False): """ Connect to a BTrDB server. @@ -57,6 +59,12 @@ def connect(conn_str=None, apikey=None, profile=None): The name of a profile containing the required connection information as found in the user's predictive grid credentials file `~/.predictivegrid/credentials.yaml`. + shareable: bool, default=False + Whether or not the connection can be "shared" in a distributed setting such + as Ray workers. If set to True, the connection can be serialized and sent + to other workers so that data can be retrieved in parallel; **however**, this + is less secure because it is possible for other users of the Ray cluster to + use your API key to fetch data. Returns ------- @@ -68,6 +76,11 @@ def connect(conn_str=None, apikey=None, profile=None): if conn_str and profile: raise ValueError("Received both conn_str and profile arguments.") + # check shareable flag and register custom serializer if necessary + if shareable: + warn("a shareable connection is potentially insecure; other users of the same cluster may be able to access your API key") + register_serializer(conn_str=conn_str, apikey=apikey, profile=profile) + # use specific profile if requested if profile: return _connect(**credentials_by_profile(profile)) diff --git a/btrdb/utils/ray.py b/btrdb/utils/ray.py index d6e00e0..0ab5f65 100644 --- a/btrdb/utils/ray.py +++ b/btrdb/utils/ray.py @@ -23,8 +23,14 @@ def register_serializer(conn_str=None, apikey=None, profile=None): `~/.predictivegrid/credentials.yaml`. """ assert ray.is_initialized(), "Need to call ray.init() before registering custom serializer" - ray.util.register_serializer( - BTrDB, serializer=btrdb_serializer, deserializer=partial(btrdb_deserializer, conn_str=conn_str, apikey=apikey, profile=profile)) + # TODO: check the version using the 'semver' package? + if ray.__version__ == "0.8.4": + ray.register_custom_serializer( + BTrDB, serializer=btrdb_serializer, deserializer=partial(btrdb_deserializer, conn_str=conn_str, apikey=apikey, profile=profile)) + elif ray.__version__ in ["1.2.0", "1.3.0"]: + # TODO: check different versions of ray? + ray.util.register_serializer( + BTrDB, serializer=btrdb_serializer, deserializer=partial(btrdb_deserializer, conn_str=conn_str, apikey=apikey, profile=profile)) def btrdb_serializer(_): """ From 74f5623aaef6b4ba0eff8c661febec51a62f400f Mon Sep 17 00:00:00 2001 From: Gabe Fierro Date: Thu, 20 May 2021 12:23:17 -0700 Subject: [PATCH 05/29] fix import --- btrdb/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/btrdb/__init__.py b/btrdb/__init__.py index b5485a5..95847e7 100644 --- a/btrdb/__init__.py +++ b/btrdb/__init__.py @@ -21,7 +21,7 @@ from btrdb.version import get_version from btrdb.utils.credentials import credentials_by_profile, credentials from btrdb.stream import MINIMUM_TIME, MAXIMUM_TIME -from btrdb.util import register_serializer +from btrdb.utils import register_serializer from warnings import warn ########################################################################## From c122166a775d8670c63884435c3be267735c283b Mon Sep 17 00:00:00 2001 From: Gabe Fierro Date: Thu, 20 May 2021 12:24:49 -0700 Subject: [PATCH 06/29] fix import --- btrdb/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/btrdb/__init__.py b/btrdb/__init__.py index 95847e7..cd14662 100644 --- a/btrdb/__init__.py +++ b/btrdb/__init__.py @@ -20,8 +20,8 @@ from btrdb.exceptions import ConnectionError from btrdb.version import get_version from btrdb.utils.credentials import credentials_by_profile, credentials +from btrdb.utils.ray import register_serializer from btrdb.stream import MINIMUM_TIME, MAXIMUM_TIME -from btrdb.utils import register_serializer from warnings import warn ########################################################################## From cd27a0b5b217fdc2fa0a3496de3271823599da37 Mon Sep 17 00:00:00 2001 From: Gabe Fierro Date: Thu, 20 May 2021 12:29:01 -0700 Subject: [PATCH 07/29] try semver --- btrdb/utils/ray.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/btrdb/utils/ray.py b/btrdb/utils/ray.py index 0ab5f65..64b2990 100644 --- a/btrdb/utils/ray.py +++ b/btrdb/utils/ray.py @@ -2,6 +2,8 @@ import ray +import semver + import btrdb from btrdb.conn import BTrDB @@ -24,13 +26,16 @@ def register_serializer(conn_str=None, apikey=None, profile=None): """ assert ray.is_initialized(), "Need to call ray.init() before registering custom serializer" # TODO: check the version using the 'semver' package? - if ray.__version__ == "0.8.4": + ver = semver.VersionInfo.parse(ray.__version__) + if ver.major == 0: ray.register_custom_serializer( BTrDB, serializer=btrdb_serializer, deserializer=partial(btrdb_deserializer, conn_str=conn_str, apikey=apikey, profile=profile)) - elif ray.__version__ in ["1.2.0", "1.3.0"]: + elif ver.major == 1 and ver.minor in range(2, 4): # TODO: check different versions of ray? ray.util.register_serializer( BTrDB, serializer=btrdb_serializer, deserializer=partial(btrdb_deserializer, conn_str=conn_str, apikey=apikey, profile=profile)) + else: + raise Exception("Ray version %s does not have custom serialization. Please upgrade to >= 1.2.0" % ray.__version__) def btrdb_serializer(_): """ From 80517caf7652db0988b206c840feeec175b922ed Mon Sep 17 00:00:00 2001 From: Michael Chestnut Date: Mon, 24 May 2021 12:41:01 -0500 Subject: [PATCH 08/29] modify setup and docs to use new repo --- docs/source/conf.py | 8 ++++---- setup.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index e221fcb..cebafa7 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -26,8 +26,8 @@ # -- Project information ----------------------------------------------------- project = 'btrdb' -copyright = '2019, Michael P. Andersen' -author = 'Michael P. Andersen' +copyright = '2021, PingThingsIO' +author = 'PingThingsIO' # The short X.Y version version = get_version() @@ -93,7 +93,7 @@ # html_theme_options = { 'show_powered_by': False, - 'github_user': 'BTrDB', + 'github_user': 'PingThingsIO', 'github_repo': 'btrdb-python', 'travis_button': False, 'github_banner': False, @@ -159,7 +159,7 @@ # author, documentclass [howto, manual, or own class]). latex_documents = [ (master_doc, 'btrdb-python.tex', 'btrdb-python Documentation', - 'Michael Andersen', 'manual'), + 'PingThingsIO', 'manual'), ] diff --git a/setup.py b/setup.py index 0e515f2..2997b26 100644 --- a/setup.py +++ b/setup.py @@ -29,11 +29,11 @@ ## Basic information NAME = "btrdb" DESCRIPTION = "Bindings to interact with the Berkeley Tree Database using gRPC." -AUTHOR = "Michael Andersen, Allen Leis" -EMAIL = "michael@steelcode.com" -MAINTAINER = "Michael Andersen" +AUTHOR = "PingThingsIO" +EMAIL = "support@pingthings.io" +MAINTAINER = "PingThingsIO" LICENSE = "BSD-3-Clause" -REPOSITORY = "https://github.com/BTrDB/btrdb-python" +REPOSITORY = "https://github.com/PingThingsIO/btrdb-python" PACKAGE = "btrdb" URL = "http://btrdb.io/" DOCS_URL = "https://btrdb.readthedocs.io/en/latest/" From 8529c5cd25da1b3013cc5188731d8920b194f2f7 Mon Sep 17 00:00:00 2001 From: Michael Chestnut Date: Wed, 26 May 2021 16:29:35 -0500 Subject: [PATCH 09/29] updating copyright --- docs/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index cebafa7..79f76de 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -26,7 +26,7 @@ # -- Project information ----------------------------------------------------- project = 'btrdb' -copyright = '2021, PingThingsIO' +copyright = '2021, Ping Things, Inc.' author = 'PingThingsIO' # The short X.Y version From fc75ca4c3ba2005bb3aaf4c294c3c108b854c3a4 Mon Sep 17 00:00:00 2001 From: Michael Chestnut Date: Thu, 10 Jun 2021 11:43:57 -0500 Subject: [PATCH 10/29] Release v5.11.1 --- btrdb/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/btrdb/version.py b/btrdb/version.py index 6df466a..c337dbe 100644 --- a/btrdb/version.py +++ b/btrdb/version.py @@ -15,7 +15,7 @@ ## Module Info ########################################################################## -__version_info__ = { 'major': 5, 'minor': 11, 'micro': 0, 'releaselevel': 'final'} + ########################################################################## ## Helper Functions From d9e943da3620ec75c8e43fb5bd8dc5c185974a1d Mon Sep 17 00:00:00 2001 From: Michael Chestnut Date: Thu, 10 Jun 2021 14:49:10 -0500 Subject: [PATCH 11/29] Release v5.11.1 --- btrdb/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/btrdb/version.py b/btrdb/version.py index c337dbe..cb44b1d 100644 --- a/btrdb/version.py +++ b/btrdb/version.py @@ -15,7 +15,7 @@ ## Module Info ########################################################################## - +__version_info__ = { 'major': 5, 'minor': 11, 'micro': 1, 'releaselevel': 'final'} ########################################################################## ## Helper Functions From e881d2e6f36b8ee3a3d649f7ab0e4c2a052c02ea Mon Sep 17 00:00:00 2001 From: Michael Chestnut Date: Thu, 10 Jun 2021 14:49:22 -0500 Subject: [PATCH 12/29] Release v5.11.2 --- btrdb/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/btrdb/version.py b/btrdb/version.py index cb44b1d..eff1b61 100644 --- a/btrdb/version.py +++ b/btrdb/version.py @@ -15,7 +15,7 @@ ## Module Info ########################################################################## -__version_info__ = { 'major': 5, 'minor': 11, 'micro': 1, 'releaselevel': 'final'} +__version_info__ = { 'major': 5, 'minor': 11, 'micro': 2, 'releaselevel': 'final'} ########################################################################## ## Helper Functions From f9d0c3d5953a3b225b56984cdcf088f92306f08e Mon Sep 17 00:00:00 2001 From: Michael Chestnut Date: Thu, 10 Jun 2021 15:35:49 -0500 Subject: [PATCH 13/29] make ray and semver dependencies optional --- btrdb/utils/ray.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/btrdb/utils/ray.py b/btrdb/utils/ray.py index 64b2990..674ab64 100644 --- a/btrdb/utils/ray.py +++ b/btrdb/utils/ray.py @@ -1,11 +1,6 @@ -from functools import partial - -import ray - -import semver - import btrdb from btrdb.conn import BTrDB +from functools import partial def register_serializer(conn_str=None, apikey=None, profile=None): """ @@ -24,6 +19,15 @@ def register_serializer(conn_str=None, apikey=None, profile=None): found in the user's predictive grid credentials file `~/.predictivegrid/credentials.yaml`. """ + try: + import ray + except ImportError: + raise ImportError("must pip install ray to register custom serializer") + try: + import semver + except ImportError: + raise ImportError("must pip install semver to register custom serializer") + assert ray.is_initialized(), "Need to call ray.init() before registering custom serializer" # TODO: check the version using the 'semver' package? ver = semver.VersionInfo.parse(ray.__version__) @@ -31,7 +35,7 @@ def register_serializer(conn_str=None, apikey=None, profile=None): ray.register_custom_serializer( BTrDB, serializer=btrdb_serializer, deserializer=partial(btrdb_deserializer, conn_str=conn_str, apikey=apikey, profile=profile)) elif ver.major == 1 and ver.minor in range(2, 4): - # TODO: check different versions of ray? + # TODO: check different versions of ray? ray.util.register_serializer( BTrDB, serializer=btrdb_serializer, deserializer=partial(btrdb_deserializer, conn_str=conn_str, apikey=apikey, profile=profile)) else: From 47ec4f43bddba2e8c7a7d14c75c31406792c5d2d Mon Sep 17 00:00:00 2001 From: Michael Chestnut Date: Thu, 10 Jun 2021 15:53:41 -0500 Subject: [PATCH 14/29] Release v5.11.3 --- btrdb/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/btrdb/version.py b/btrdb/version.py index eff1b61..d6cd184 100644 --- a/btrdb/version.py +++ b/btrdb/version.py @@ -15,7 +15,7 @@ ## Module Info ########################################################################## -__version_info__ = { 'major': 5, 'minor': 11, 'micro': 2, 'releaselevel': 'final'} +__version_info__ = { 'major': 5, 'minor': 11, 'micro': 3, 'releaselevel': 'final'} ########################################################################## ## Helper Functions From 2fd10035f492800004c872cca225235b4ec05461 Mon Sep 17 00:00:00 2001 From: Michael Chestnut Date: Thu, 10 Jun 2021 16:07:44 -0500 Subject: [PATCH 15/29] Release v5.11.4 --- btrdb/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/btrdb/version.py b/btrdb/version.py index d6cd184..69a362a 100644 --- a/btrdb/version.py +++ b/btrdb/version.py @@ -15,7 +15,7 @@ ## Module Info ########################################################################## -__version_info__ = { 'major': 5, 'minor': 11, 'micro': 3, 'releaselevel': 'final'} +__version_info__ = { 'major': 5, 'minor': 11, 'micro': 4, 'releaselevel': 'final'} ########################################################################## ## Helper Functions From 3ca1d530c9bf4f0f76bf80ccab0413e03b722e6c Mon Sep 17 00:00:00 2001 From: Michael Chestnut Date: Thu, 10 Jun 2021 17:17:28 -0500 Subject: [PATCH 16/29] make sed cmd in release.sh compatatible with osx --- release.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release.sh b/release.sh index 6f6595a..9104416 100755 --- a/release.sh +++ b/release.sh @@ -35,8 +35,8 @@ fi echo "Setting version to v$1.$2.$3" -VERION_CODE="__version_info__ = { 'major': $1, 'minor': $2, 'micro': $3, 'releaselevel': 'final'}" -sed -i "s/^__version_info__.*$/${VERION_CODE}/g" btrdb/version.py +VERSION_CODE="__version_info__ = { 'major': $1, 'minor': $2, 'micro': $3, 'releaselevel': 'final'}" +sed -i.bak "s/^__version_info__.*$/${VERSION_CODE}/g" btrdb/version.py git add btrdb/version.py git commit -m "Release v$1.$2.$3" From 0f47f85a6c839dd34d597cc98bf71efe86118f62 Mon Sep 17 00:00:00 2001 From: Michael Chestnut Date: Fri, 25 Jun 2021 09:14:34 -0500 Subject: [PATCH 17/29] update build status in docs to show github actions --- docs/source/index.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/index.rst b/docs/source/index.rst index 66d2de0..da1b71e 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,8 +1,8 @@ Welcome to btrdb docs! ====================== -.. image:: https://img.shields.io/travis/BTrDB/btrdb-python/master.svg - :target: https://travis-ci.org/BTrDB/btrdb-python +.. image:: https://github.com/PingThingsIO/btrdb-python/actions/workflows/release.yaml/badge.svg + :target: https://github.com/PingThingsIO/btrdb-python/actions .. image:: https://readthedocs.org/projects/btrdb/badge/?version=latest :target: https://btrdb.readthedocs.io/en/latest/ From d7eef59c1f8c9b05dd58e270256c6e575790c6f3 Mon Sep 17 00:00:00 2001 From: Michael Chestnut Date: Fri, 25 Jun 2021 16:57:12 -0500 Subject: [PATCH 18/29] Release v5.11.5 --- btrdb/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/btrdb/version.py b/btrdb/version.py index 69a362a..b602f1a 100644 --- a/btrdb/version.py +++ b/btrdb/version.py @@ -15,7 +15,7 @@ ## Module Info ########################################################################## -__version_info__ = { 'major': 5, 'minor': 11, 'micro': 4, 'releaselevel': 'final'} +__version_info__ = { 'major': 5, 'minor': 11, 'micro': 5, 'releaselevel': 'final'} ########################################################################## ## Helper Functions From bb16eb1d4e49b0156134436df2c2a12eb2daccc2 Mon Sep 17 00:00:00 2001 From: Michael Chestnut Date: Fri, 25 Jun 2021 17:16:20 -0500 Subject: [PATCH 19/29] Release v5.11.6 --- btrdb/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/btrdb/version.py b/btrdb/version.py index b602f1a..809ca7e 100644 --- a/btrdb/version.py +++ b/btrdb/version.py @@ -15,7 +15,7 @@ ## Module Info ########################################################################## -__version_info__ = { 'major': 5, 'minor': 11, 'micro': 5, 'releaselevel': 'final'} +__version_info__ = { 'major': 5, 'minor': 11, 'micro': 6, 'releaselevel': 'final'} ########################################################################## ## Helper Functions From 6bd543af2c397908263a624e07a36eea987f69e0 Mon Sep 17 00:00:00 2001 From: mchestnut91 <40185521+mchestnut91@users.noreply.github.com> Date: Mon, 28 Jun 2021 15:43:14 -0500 Subject: [PATCH 20/29] Update docs link in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7a808fe..f347a6d 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ These are BTrDB Bindings for Python allowing you painless and productive access ## Sample Code -Our goal is to make BTrDB as easy to use as possible, focusing on integration with other tools and the productivity of our users. In keeping with this we continue to add new features such as easy transformation to numpy arrays, pandas Series, etc. See the sample code below and then checkout our [documentation](https://btrdb.readthedocs.io/en/latest/) for more in depth instructions. +Our goal is to make BTrDB as easy to use as possible, focusing on integration with other tools and the productivity of our users. In keeping with this we continue to add new features such as easy transformation to numpy arrays, pandas Series, etc. See the sample code below and then checkout our [documentation](https://btrdb-python.readthedocs.io/en/latest/) for more in depth instructions. import btrdb From 14a851e5ba5bf3555566ce33fbd3831e02343301 Mon Sep 17 00:00:00 2001 From: Michael Chestnut Date: Mon, 28 Jun 2021 15:45:01 -0500 Subject: [PATCH 21/29] change link to docs in setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 2997b26..a047ce5 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ REPOSITORY = "https://github.com/PingThingsIO/btrdb-python" PACKAGE = "btrdb" URL = "http://btrdb.io/" -DOCS_URL = "https://btrdb.readthedocs.io/en/latest/" +DOCS_URL = "https://btrdb-python.readthedocs.io/en/latest/" ## Define the keywords KEYWORDS = ('btrdb', 'berkeley', 'timeseries', 'database', 'bindings' 'gRPC') From f07a5d16e744f030889fbe3925aa8915e1a47ab3 Mon Sep 17 00:00:00 2001 From: mchestnut91 <40185521+mchestnut91@users.noreply.github.com> Date: Tue, 29 Jun 2021 11:47:58 -0500 Subject: [PATCH 22/29] update second docs link in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f347a6d..778c1a5 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ The project documentation is written in reStructuredText and is built using Sphi $ make html -This will build the HTML documentation locally in `docs/build`, which can be viewed using `open docs/build/index.html`. Other formats (PDF, epub, etc) can be built using `docs/Makefile`. The documentation is automatically built on every GitHub release and hosted on [Read The Docs](https://btrdb.readthedocs.io/en/latest/). +This will build the HTML documentation locally in `docs/build`, which can be viewed using `open docs/build/index.html`. Other formats (PDF, epub, etc) can be built using `docs/Makefile`. The documentation is automatically built on every GitHub release and hosted on [Read The Docs](https://btrdb-python.readthedocs.io/en/latest/). Note that the documentation also requires Sphix and other dependencies to successfully build: `pip install -r docs/requirements.txt`. From e9801fde84a763669b1e9a7cd3f19502d114aa83 Mon Sep 17 00:00:00 2001 From: mchestnut91 <40185521+mchestnut91@users.noreply.github.com> Date: Tue, 29 Jun 2021 15:17:44 -0500 Subject: [PATCH 23/29] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 778c1a5..7a808fe 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ These are BTrDB Bindings for Python allowing you painless and productive access ## Sample Code -Our goal is to make BTrDB as easy to use as possible, focusing on integration with other tools and the productivity of our users. In keeping with this we continue to add new features such as easy transformation to numpy arrays, pandas Series, etc. See the sample code below and then checkout our [documentation](https://btrdb-python.readthedocs.io/en/latest/) for more in depth instructions. +Our goal is to make BTrDB as easy to use as possible, focusing on integration with other tools and the productivity of our users. In keeping with this we continue to add new features such as easy transformation to numpy arrays, pandas Series, etc. See the sample code below and then checkout our [documentation](https://btrdb.readthedocs.io/en/latest/) for more in depth instructions. import btrdb @@ -105,7 +105,7 @@ The project documentation is written in reStructuredText and is built using Sphi $ make html -This will build the HTML documentation locally in `docs/build`, which can be viewed using `open docs/build/index.html`. Other formats (PDF, epub, etc) can be built using `docs/Makefile`. The documentation is automatically built on every GitHub release and hosted on [Read The Docs](https://btrdb-python.readthedocs.io/en/latest/). +This will build the HTML documentation locally in `docs/build`, which can be viewed using `open docs/build/index.html`. Other formats (PDF, epub, etc) can be built using `docs/Makefile`. The documentation is automatically built on every GitHub release and hosted on [Read The Docs](https://btrdb.readthedocs.io/en/latest/). Note that the documentation also requires Sphix and other dependencies to successfully build: `pip install -r docs/requirements.txt`. From a23e628a14f62c36635d6571a3c3607b23e74b78 Mon Sep 17 00:00:00 2001 From: Michael Chestnut Date: Tue, 29 Jun 2021 15:59:03 -0500 Subject: [PATCH 24/29] change path in setup back to old docs --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a047ce5..2997b26 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ REPOSITORY = "https://github.com/PingThingsIO/btrdb-python" PACKAGE = "btrdb" URL = "http://btrdb.io/" -DOCS_URL = "https://btrdb-python.readthedocs.io/en/latest/" +DOCS_URL = "https://btrdb.readthedocs.io/en/latest/" ## Define the keywords KEYWORDS = ('btrdb', 'berkeley', 'timeseries', 'database', 'bindings' 'gRPC') From 31b3cb191fc404df0349b51f749cfd67a5fde5d0 Mon Sep 17 00:00:00 2001 From: David Konigsberg <72822263+davidkonigsberg@users.noreply.github.com> Date: Thu, 30 Sep 2021 15:17:34 -0400 Subject: [PATCH 25/29] fixes Let's Encrypt cert issue (#9) --- btrdb/conn.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/btrdb/conn.py b/btrdb/conn.py index 55058a4..a07c162 100644 --- a/btrdb/conn.py +++ b/btrdb/conn.py @@ -65,12 +65,20 @@ def __init__(self, addrportstr, apikey=None): # grpc bundles its own CA certs which will work for all normal SSL # certificates but will fail for custom CA certs. Allow the user # to specify a CA bundle via env var to overcome this - ca_bundle = os.getenv("BTRDB_CA_BUNDLE","") - if ca_bundle != "": + env_bundle = os.getenv("BTRDB_CA_BUNDLE", "") + os_certs = "/etc/ssl/certs/ca-certificates.crt" + ca_bundle = env_bundle + if ca_bundle == "": + ca_bundle = os_certs + try: with open(ca_bundle, "rb") as f: contents = f.read() - else: - contents = None + except Exception: + if env_bundle != "": + # The user has given us something but we can't use it, we need to make noise + raise Exception("BTRDB_CA_BUNDLE(%s) env is defined but could not read file" % ca_bundle) + else: + contents = None if apikey is None: self.channel = grpc.secure_channel( From 39ec946414d4aa862f510b1f513ab1dc57146cb1 Mon Sep 17 00:00:00 2001 From: Allen Leis Date: Mon, 4 Oct 2021 12:16:27 -0400 Subject: [PATCH 26/29] bundles certifi certs as dependency (#10) --- btrdb/conn.py | 10 ++++++++-- requirements.txt | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/btrdb/conn.py b/btrdb/conn.py index a07c162..bb79f2f 100644 --- a/btrdb/conn.py +++ b/btrdb/conn.py @@ -18,6 +18,7 @@ import os import re import json +import certifi import uuid as uuidlib import grpc @@ -66,10 +67,15 @@ def __init__(self, addrportstr, apikey=None): # certificates but will fail for custom CA certs. Allow the user # to specify a CA bundle via env var to overcome this env_bundle = os.getenv("BTRDB_CA_BUNDLE", "") - os_certs = "/etc/ssl/certs/ca-certificates.crt" + + # certifi certs are provided as part of this package install + # https://github.com/certifi/python-certifi + lib_certs = certifi.where() + ca_bundle = env_bundle + if ca_bundle == "": - ca_bundle = os_certs + ca_bundle = lib_certs try: with open(ca_bundle, "rb") as f: contents = f.read() diff --git a/requirements.txt b/requirements.txt index b12c1a6..0d89f56 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,4 +6,5 @@ grpcio-tools>=1.19.0 pytz # Misc libraries -pyyaml \ No newline at end of file +pyyaml +certifi \ No newline at end of file From ff0824c04b6dc36496956ecc89a8b5963f236e6c Mon Sep 17 00:00:00 2001 From: looselycoupled Date: Mon, 4 Oct 2021 12:24:56 -0400 Subject: [PATCH 27/29] Release v5.11.7 --- btrdb/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/btrdb/version.py b/btrdb/version.py index 809ca7e..4bff3e4 100644 --- a/btrdb/version.py +++ b/btrdb/version.py @@ -15,7 +15,7 @@ ## Module Info ########################################################################## -__version_info__ = { 'major': 5, 'minor': 11, 'micro': 6, 'releaselevel': 'final'} +__version_info__ = { 'major': 5, 'minor': 11, 'micro': 7, 'releaselevel': 'final'} ########################################################################## ## Helper Functions From 621823396f603b76b4e6d1f60ceea42cab9b323f Mon Sep 17 00:00:00 2001 From: Jacob Alperin-Sheriff Date: Wed, 27 Oct 2021 17:21:38 -0400 Subject: [PATCH 28/29] Added code to handle case where dataframe created by to_dataframe is empty due to empty StreamSet(s)? --- btrdb/transformers.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/btrdb/transformers.py b/btrdb/transformers.py index 12f7979..1cf346c 100644 --- a/btrdb/transformers.py +++ b/btrdb/transformers.py @@ -145,13 +145,15 @@ def to_dataframe(streamset, columns=None, agg="mean", name_callable=None): df = pd.DataFrame(to_dict(streamset,agg=agg)) - df = df.set_index("time") - if agg == "all" and not streamset.allow_window: - stream_names = [[s.collection, s.name, prop] for s in streamset._streams for prop in _STAT_PROPERTIES] - df.columns=pd.MultiIndex.from_tuples(stream_names) - else: - df.columns = columns if columns else _stream_names(streamset, name_callable) + if not df.empty: + df = df.set_index("time") + + if agg == "all" and not streamset.allow_window: + stream_names = [[s.collection, s.name, prop] for s in streamset._streams for prop in _STAT_PROPERTIES] + df.columns=pd.MultiIndex.from_tuples(stream_names) + else: + df.columns = columns if columns else _stream_names(streamset, name_callable) return df From a5a897c3822668c84a456677479a81838e729e15 Mon Sep 17 00:00:00 2001 From: Jacob Alperin-Sheriff Date: Thu, 18 Nov 2021 17:19:48 -0500 Subject: [PATCH 29/29] stuff --- bob.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 bob.txt diff --git a/bob.txt b/bob.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/bob.txt @@ -0,0 +1 @@ +