Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9b7fb1e
Fix build deprecation warnings in using pyproject.toml and setuptool …
jleifnf Sep 29, 2023
8c4fed5
remove deprecated columns arg from to_dataframe and arrow_to_datafram…
jleifnf Oct 3, 2023
19edda0
Subscription endpoint (#63)
justinGilmer Nov 16, 2023
87a789a
`arrow_to_dataframe` return with `time` as index (#62)
jleifnf Nov 27, 2023
f7afb11
Update changelog, and update stream logic to sort arrow tables joined…
justinGilmer Nov 27, 2023
9048df0
fix NoneType error for earliest/latest for empty streams (#64)
jleifnf Nov 28, 2023
f54e5f2
FutureWarning for streams_in_collection to return StreamSet (#60)
jleifnf Nov 28, 2023
534fe51
Update pre-commit versions and add coverage report to gh actions (#68)
jleifnf Dec 18, 2023
13399e8
Add to_timedelta method for pointwidth class (#69)
jleifnf Dec 18, 2023
cf6e0b2
Method to get first and last timestamps from aligned_windows (#70)
jleifnf Dec 18, 2023
b7f6032
Remove non-required dependencies, migrate to 'data' optional dependen…
justinGilmer Dec 20, 2023
0857da9
Add option for specifying the schema of the returned data. (#51)
andrewchambers Jan 16, 2024
d88292f
Update exception handling to support RpcErrors. (#72)
justinGilmer Jan 16, 2024
7e69f1d
Include 3.11 for testing. (#74)
justinGilmer Feb 7, 2024
bdd7b68
Improve arrow_to_dataframe for large amounts of columns (#73)
jleifnf Feb 7, 2024
405fb6f
Test new join (#80)
justinGilmer Feb 23, 2024
78dbfe5
Initial docstrings and a new test. (#82)
justinGilmer Mar 25, 2024
6c157d2
Update changelog for next release.
justinGilmer Mar 25, 2024
6051153
Update github actions dependencies to recent versions.
justinGilmer Mar 26, 2024
e095afe
Further changelog refinements.
justinGilmer Mar 26, 2024
72ad2c8
Merge branch 'master' into staging
justinGilmer Mar 26, 2024
4648eb5
Update precommit deps.
justinGilmer Mar 26, 2024
cccdfe0
Release v5.32.0
youngale-pingthings Mar 26, 2024
0b6ed67
Add changes to release script
youngale-pingthings Mar 26, 2024
462925e
Switch to double quotes on release
youngale-pingthings Mar 26, 2024
cb3c820
Remove preceding space in release
youngale-pingthings Mar 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0 # get full git history
- uses: actions/setup-python@v3
- uses: actions/setup-python@v5
with:
cache: 'pip'
- name: Install pre-commit
run: |
pip install pre-commit
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v41
uses: tj-actions/changed-files@v43
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run pre-commit
Expand Down
70 changes: 35 additions & 35 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,41 @@ on:
- synchronize
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
- "v[0-9]+.[0-9]+.[0-9]+*"

jobs:

test-suite:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, '3.10']
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }} ${{ matrix.os }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r tests/requirements.txt
- name: Test with pytest
run: |
pytest

- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }} ${{ matrix.os }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r tests/requirements.txt
- name: Test with pytest
run: |
pytest --cov-report= --cov=btrdb # suppress coverage report here
- name: Coverage Report
run: |
coverage report -m

release:
needs:
- test-suite
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Create Release
id: create_release
uses: actions/create-release@v1
Expand All @@ -51,28 +52,27 @@ jobs:
draft: false
prerelease: false


deploy:
needs:
- release
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel build
- name: Build and publish
run: |
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel build
- name: Build and publish
run: |
python -m build --sdist --wheel --outdir dist/ .
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_DEPLOYMENT_TOKEN }}
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_DEPLOYMENT_TOKEN }}
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
exclude: ^(setup.cfg|btrdb/grpcinterface)
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 24.3.0
hooks:
- id: black-jupyter
args: [--line-length=88]
exclude: btrdb/grpcinterface/.*\.py
- repo: https://github.com/pycqa/isort
rev: 5.11.5
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
args: [--profile=black, --line-length=88]
exclude: btrdb/grpcinterface/.*\.py
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 7.0.0
hooks:
- id: flake8
args: [--config=setup.cfg]
Expand Down
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,39 @@
# Changelog

## 5.32.0 - YYYY-MM-DD

### What's Changed
- Initial docstring overhaul and a new test for better documentation and test coverage. by @JustinGilmer in #82
- Test new join functionality for improved data loading for windowed queries. by @JustinGilmer in #80
- Improve `arrow_to_dataframe` function for handling large amounts of columns, enhancing performance and usability. by @Jefflinf in #73
- Expand testing to include Python 3.11, ensuring compatibility and stability. by @JustinGilmer in #74
- Update exception handling to better support `RpcErrors`, improving error management and debugging. by @JustinGilmer in #72
- Introduce an option for specifying the schema of the returned data, allowing for more flexibility in data handling. by @TODO in #51
- Remove non-required dependencies and migrate to 'data' optional dependency for a lighter package and easier installation. by @JustinGilmer in #71
- New method to get first and last timestamps from `aligned_windows`, enhancing data analysis capabilities. by @Jefflinf in #70
- Add `to_timedelta` method for `pointwidth` class, providing more options for time-based data manipulation. by @Jefflinf in #69

### Fixed
- Fix `NoneType` error for `earliest/latest` for empty streams, ensuring reliability and error handling. by @Jefflinf in #64
- Correct integration tests where the time column is not automatically set as the index, improving test accuracy and reliability. by @JustinGilmer in #56

### Deprecated
- FutureWarning for `streams_in_collection` to return `StreamSet` in the future, preparing users for upcoming API changes. by @Jefflinf in #60

**Full Changelog**: [GitHub compare view](https://github.com/PingThingsIO/btrdb-python/compare/v5.31.0...v5.32.0)


## 5.31.0
## What's Changed
* Release v5.30.2 by @youngale-pingthings in https://github.com/PingThingsIO/btrdb-python/pull/42
* Have release script update pyproject.toml file by @youngale-pingthings in https://github.com/PingThingsIO/btrdb-python/pull/48
* Provide option to sort the arrow tables by @justinGilmer in https://github.com/PingThingsIO/btrdb-python/pull/47
* [sc-25841] Remove 4MB limit for gRPC message payloads by @justinGilmer in https://github.com/PingThingsIO/btrdb-python/pull/49
* Update documentation for arrow methods by @justinGilmer in https://github.com/PingThingsIO/btrdb-python/pull/50
* Update from staging by @justinGilmer in https://github.com/PingThingsIO/btrdb-python/pull/54
* Sort tables by time by default for any `pyarrow` tables. by @justinGilmer in
* Fix deprecation warnings for pip installations. by @jleifnf in

## 5.30.2
### What's Changed
* Update readthedocs to new yaml for testing. by @justinGilmer in https://github.com/PingThingsIO/btrdb-python/pull/40
Expand Down
29 changes: 24 additions & 5 deletions btrdb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,18 @@ def connect(conn_str=None, apikey=None, profile=None, shareable=False):
Parameters
----------
conn_str: str, default=None
The address and port of the cluster to connect to, e.g. `192.168.1.1:4411`.
If set to None, will look in the environment variable `$BTRDB_ENDPOINTS`
The address and port of the cluster to connect to, e.g. ``192.168.1.1:4411``.
If set to None, will look in the environment variable ``$BTRDB_ENDPOINTS``
(recommended).
apikey: str, default=None
The API key used to authenticate requests (optional). If None, the key
is looked up from the environment variable `$BTRDB_API_KEY`.
is looked up from the environment variable ``$BTRDB_API_KEY``.
profile: str, default=None
The name of a profile containing the required connection information as
found in the user's predictive grid credentials file
`~/.predictivegrid/credentials.yaml`.
``~/.predictivegrid/credentials.yaml``.
shareable: bool, default=False
Whether or not the connection can be "shared" in a distributed setting such
Whether 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
Expand All @@ -74,6 +74,25 @@ def connect(conn_str=None, apikey=None, profile=None, shareable=False):
db : BTrDB
An instance of the BTrDB context to directly interact with the database.

Examples
--------
This example looks for the env variables: ``BTRDB_ENDPOINTS`` and ``BTRDB_API_KEY``.

>>> conn = btrdb.connect()
<btrdb.conn.BTrDB at 0x...>


Connect to the platform by looking for the relevant platform profile
in ``${HOME}/.predictivegrid/credentials.yaml`` if the file is present.

>>> conn = btrdb.connect(profile='test')
<btrdb.conn.BTrDB at 0x...>

If you provide incorrect credentials, you will get an error.

>>> conn = btrdb.connect(conn_str="192.168.1.1:4411", apikey="NONSENSICAL_API_KEY")


"""
# do not allow user to provide both address and profile
if conn_str and profile:
Expand Down
Loading