Skip to content

Commit e1fc143

Browse files
justinGilmerjleifnfandrewchambersyoungale-pingthings
authored
Update from latest staging. preparing for new release (#83)
Co-authored-by: Jeff Lin <42981468+jleifnf@users.noreply.github.com> Co-authored-by: Andrew Chambers <andrew@pingthings.io> Co-authored-by: andrewchambers <andrewchamberss@gmail.com> Co-authored-by: Alexander Young <alexander.young@pingthings.io>
1 parent bf9ce48 commit e1fc143

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2890
-1450
lines changed

.github/workflows/pre-commit.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ jobs:
1818
pre-commit:
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/checkout@v3
21+
- uses: actions/checkout@v4
2222
with:
2323
token: ${{ secrets.GITHUB_TOKEN }}
2424
fetch-depth: 0 # get full git history
25-
- uses: actions/setup-python@v3
25+
- uses: actions/setup-python@v5
2626
with:
2727
cache: 'pip'
2828
- name: Install pre-commit
2929
run: |
3030
pip install pre-commit
3131
- name: Get changed files
3232
id: changed-files
33-
uses: tj-actions/changed-files@v41
33+
uses: tj-actions/changed-files@v43
3434
with:
3535
token: ${{ secrets.GITHUB_TOKEN }}
3636
- name: Run pre-commit

.github/workflows/release.yaml

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,41 @@ on:
66
- synchronize
77
push:
88
tags:
9-
- 'v[0-9]+.[0-9]+.[0-9]+*'
9+
- "v[0-9]+.[0-9]+.[0-9]+*"
1010

1111
jobs:
12-
1312
test-suite:
1413
runs-on: ${{ matrix.os }}
1514
strategy:
1615
matrix:
17-
python-version: [3.7, 3.8, 3.9, '3.10']
16+
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]
1817
os: [ubuntu-latest, macos-latest, windows-latest]
1918

2019
steps:
21-
- uses: actions/checkout@v3
22-
- name: Set up Python ${{ matrix.python-version }} ${{ matrix.os }}
23-
uses: actions/setup-python@v4
24-
with:
25-
python-version: ${{ matrix.python-version }}
26-
- name: Install dependencies
27-
run: |
28-
python -m pip install --upgrade pip
29-
pip install -r requirements.txt
30-
pip install -r tests/requirements.txt
31-
- name: Test with pytest
32-
run: |
33-
pytest
34-
20+
- uses: actions/checkout@v4
21+
- name: Set up Python ${{ matrix.python-version }} ${{ matrix.os }}
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install -r requirements.txt
29+
pip install -r tests/requirements.txt
30+
- name: Test with pytest
31+
run: |
32+
pytest --cov-report= --cov=btrdb # suppress coverage report here
33+
- name: Coverage Report
34+
run: |
35+
coverage report -m
3536
3637
release:
3738
needs:
3839
- test-suite
3940
if: startsWith(github.ref, 'refs/tags/')
4041
runs-on: ubuntu-latest
4142
steps:
42-
- uses: actions/checkout@v3
43+
- uses: actions/checkout@v4
4344
- name: Create Release
4445
id: create_release
4546
uses: actions/create-release@v1
@@ -51,28 +52,27 @@ jobs:
5152
draft: false
5253
prerelease: false
5354

54-
5555
deploy:
5656
needs:
5757
- release
5858
if: startsWith(github.ref, 'refs/tags/')
5959
runs-on: ubuntu-latest
6060

6161
steps:
62-
- uses: actions/checkout@v3
63-
- name: Set up Python
64-
uses: actions/setup-python@v4
65-
with:
66-
python-version: '3.8'
67-
- name: Install dependencies
68-
run: |
69-
python -m pip install --upgrade pip
70-
pip install setuptools wheel build
71-
- name: Build and publish
72-
run: |
62+
- uses: actions/checkout@v4
63+
- name: Set up Python
64+
uses: actions/setup-python@v5
65+
with:
66+
python-version: "3.10"
67+
- name: Install dependencies
68+
run: |
69+
python -m pip install --upgrade pip
70+
pip install setuptools wheel build
71+
- name: Build and publish
72+
run: |
7373
python -m build --sdist --wheel --outdir dist/ .
74-
- name: Publish package
75-
uses: pypa/gh-action-pypi-publish@release/v1
76-
with:
77-
user: __token__
78-
password: ${{ secrets.PYPI_DEPLOYMENT_TOKEN }}
74+
- name: Publish package
75+
uses: pypa/gh-action-pypi-publish@release/v1
76+
with:
77+
user: __token__
78+
password: ${{ secrets.PYPI_DEPLOYMENT_TOKEN }}

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.4.0
3+
rev: v4.5.0
44
hooks:
55
- id: check-yaml
66
- id: end-of-file-fixer
77
- id: trailing-whitespace
88
exclude: ^(setup.cfg|btrdb/grpcinterface)
99
- repo: https://github.com/psf/black
10-
rev: 23.3.0
10+
rev: 24.3.0
1111
hooks:
1212
- id: black-jupyter
1313
args: [--line-length=88]
1414
exclude: btrdb/grpcinterface/.*\.py
1515
- repo: https://github.com/pycqa/isort
16-
rev: 5.11.5
16+
rev: 5.13.2
1717
hooks:
1818
- id: isort
1919
name: isort (python)
2020
args: [--profile=black, --line-length=88]
2121
exclude: btrdb/grpcinterface/.*\.py
2222
- repo: https://github.com/PyCQA/flake8
23-
rev: 6.0.0
23+
rev: 7.0.0
2424
hooks:
2525
- id: flake8
2626
args: [--config=setup.cfg]

CHANGELOG.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,39 @@
11
# Changelog
2+
3+
## 5.32.0 - YYYY-MM-DD
4+
5+
### What's Changed
6+
- Initial docstring overhaul and a new test for better documentation and test coverage. by @JustinGilmer in #82
7+
- Test new join functionality for improved data loading for windowed queries. by @JustinGilmer in #80
8+
- Improve `arrow_to_dataframe` function for handling large amounts of columns, enhancing performance and usability. by @Jefflinf in #73
9+
- Expand testing to include Python 3.11, ensuring compatibility and stability. by @JustinGilmer in #74
10+
- Update exception handling to better support `RpcErrors`, improving error management and debugging. by @JustinGilmer in #72
11+
- Introduce an option for specifying the schema of the returned data, allowing for more flexibility in data handling. by @TODO in #51
12+
- Remove non-required dependencies and migrate to 'data' optional dependency for a lighter package and easier installation. by @JustinGilmer in #71
13+
- New method to get first and last timestamps from `aligned_windows`, enhancing data analysis capabilities. by @Jefflinf in #70
14+
- Add `to_timedelta` method for `pointwidth` class, providing more options for time-based data manipulation. by @Jefflinf in #69
15+
16+
### Fixed
17+
- Fix `NoneType` error for `earliest/latest` for empty streams, ensuring reliability and error handling. by @Jefflinf in #64
18+
- Correct integration tests where the time column is not automatically set as the index, improving test accuracy and reliability. by @JustinGilmer in #56
19+
20+
### Deprecated
21+
- FutureWarning for `streams_in_collection` to return `StreamSet` in the future, preparing users for upcoming API changes. by @Jefflinf in #60
22+
23+
**Full Changelog**: [GitHub compare view](https://github.com/PingThingsIO/btrdb-python/compare/v5.31.0...v5.32.0)
24+
25+
26+
## 5.31.0
27+
## What's Changed
28+
* Release v5.30.2 by @youngale-pingthings in https://github.com/PingThingsIO/btrdb-python/pull/42
29+
* Have release script update pyproject.toml file by @youngale-pingthings in https://github.com/PingThingsIO/btrdb-python/pull/48
30+
* Provide option to sort the arrow tables by @justinGilmer in https://github.com/PingThingsIO/btrdb-python/pull/47
31+
* [sc-25841] Remove 4MB limit for gRPC message payloads by @justinGilmer in https://github.com/PingThingsIO/btrdb-python/pull/49
32+
* Update documentation for arrow methods by @justinGilmer in https://github.com/PingThingsIO/btrdb-python/pull/50
33+
* Update from staging by @justinGilmer in https://github.com/PingThingsIO/btrdb-python/pull/54
34+
* Sort tables by time by default for any `pyarrow` tables. by @justinGilmer in
35+
* Fix deprecation warnings for pip installations. by @jleifnf in
36+
237
## 5.30.2
338
### What's Changed
439
* Update readthedocs to new yaml for testing. by @justinGilmer in https://github.com/PingThingsIO/btrdb-python/pull/40

btrdb/__init__.py

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,18 @@ def connect(conn_str=None, apikey=None, profile=None, shareable=False):
5252
Parameters
5353
----------
5454
conn_str: str, default=None
55-
The address and port of the cluster to connect to, e.g. `192.168.1.1:4411`.
56-
If set to None, will look in the environment variable `$BTRDB_ENDPOINTS`
55+
The address and port of the cluster to connect to, e.g. ``192.168.1.1:4411``.
56+
If set to None, will look in the environment variable ``$BTRDB_ENDPOINTS``
5757
(recommended).
5858
apikey: str, default=None
5959
The API key used to authenticate requests (optional). If None, the key
60-
is looked up from the environment variable `$BTRDB_API_KEY`.
60+
is looked up from the environment variable ``$BTRDB_API_KEY``.
6161
profile: str, default=None
6262
The name of a profile containing the required connection information as
6363
found in the user's predictive grid credentials file
64-
`~/.predictivegrid/credentials.yaml`.
64+
``~/.predictivegrid/credentials.yaml``.
6565
shareable: bool, default=False
66-
Whether or not the connection can be "shared" in a distributed setting such
66+
Whether the connection can be "shared" in a distributed setting such
6767
as Ray workers. If set to True, the connection can be serialized and sent
6868
to other workers so that data can be retrieved in parallel; **however**, this
6969
is less secure because it is possible for other users of the Ray cluster to
@@ -74,6 +74,25 @@ def connect(conn_str=None, apikey=None, profile=None, shareable=False):
7474
db : BTrDB
7575
An instance of the BTrDB context to directly interact with the database.
7676
77+
Examples
78+
--------
79+
This example looks for the env variables: ``BTRDB_ENDPOINTS`` and ``BTRDB_API_KEY``.
80+
81+
>>> conn = btrdb.connect()
82+
<btrdb.conn.BTrDB at 0x...>
83+
84+
85+
Connect to the platform by looking for the relevant platform profile
86+
in ``${HOME}/.predictivegrid/credentials.yaml`` if the file is present.
87+
88+
>>> conn = btrdb.connect(profile='test')
89+
<btrdb.conn.BTrDB at 0x...>
90+
91+
If you provide incorrect credentials, you will get an error.
92+
93+
>>> conn = btrdb.connect(conn_str="192.168.1.1:4411", apikey="NONSENSICAL_API_KEY")
94+
95+
7796
"""
7897
# do not allow user to provide both address and profile
7998
if conn_str and profile:

0 commit comments

Comments
 (0)