Skip to content

Commit 3401f62

Browse files
authored
VER: Release 0.68.0
2 parents a773d3c + 65882db commit 3401f62

File tree

9 files changed

+37
-18
lines changed

9 files changed

+37
-18
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
os: [ubuntu-latest, macos-latest, windows-latest]
13-
python-version: ["3.10", "3.11", "3.12", "3.13"]
13+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
1414
name: build - Python ${{ matrix.python-version }} (${{ matrix.os }})
1515
runs-on: ${{ matrix.os }}
1616

CHANGELOG.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## 0.68.0 - 2025-12-09
4+
5+
This release adds support for Python 3.14.
6+
7+
#### Enhancements
8+
- Added support for Python 3.14
9+
- Functions which accept a path as an argument now expand user directories
10+
- Upgraded `databento-dbn` to 0.45.0
11+
- Added support for Python 3.14
12+
313
## 0.67.0 - 2025-12-02
414

515
#### Enhancements
@@ -351,7 +361,7 @@ was preventing `ts_out` from being correctly decoded in the Python DBNDecoder
351361

352362
## 0.45.0 - 2024-11-12
353363

354-
This release adds support for Python v3.13.
364+
This release adds support for Python 3.13.
355365

356366
#### Enhancements
357367
- Added support for Python 3.13
@@ -675,7 +685,7 @@ This release adds support for transcoding DBN data into Apache parquet.
675685

676686
## 0.24.0 - 2023-11-23
677687

678-
This release adds support for DBN v2 as well as Python v3.12.
688+
This release adds support for DBN v2 as well as Python 3.12.
679689

680690
DBN v2 delivers improvements to the `Metadata` header symbology, new `stype_in` and `stype_out` fields for `SymbolMappingMsg`, and extends the symbol field length for `SymbolMappingMsg` and `InstrumentDefMsg`. The entire change notes are available [here](https://github.com/databento/dbn/releases/tag/v0.14.0). Users who wish to convert DBN v1 files to v2 can use the `dbn-cli` tool available in the [databento-dbn](https://github.com/databento/dbn/) crate. On a future date, the Databento live and historical APIs will stop serving DBN v1.
681691

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The library is fully compatible with distributions of Anaconda 2023.x and above.
3232
The minimum dependencies as found in the `pyproject.toml` are also listed below:
3333
- python = "^3.10"
3434
- aiohttp = "^3.8.3"
35-
- databento-dbn = "~0.44.0"
35+
- databento-dbn = "~0.45.0"
3636
- numpy = ">=1.23.5"
3737
- pandas = ">=1.5.3"
3838
- pip-system-certs = ">=4.0" (Windows only)

databento/common/dbnstore.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
from databento.common.validation import validate_enum
6161
from databento.common.validation import validate_file_write_path
6262
from databento.common.validation import validate_maybe_enum
63+
from databento.common.validation import validate_path
6364

6465

6566
logger = logging.getLogger(__name__)
@@ -138,15 +139,15 @@ class FileDataSource(DataSource):
138139
The name of the file.
139140
nbytes : int
140141
The size of the data in bytes; equal to the file size.
141-
path : PathLike[str] or str
142+
path : Path
142143
The path of the file.
143144
reader : IO[bytes]
144145
A `BufferedReader` for this file-backed data.
145146
146147
"""
147148

148-
def __init__(self, source: PathLike[str] | str):
149-
self._path = Path(source)
149+
def __init__(self, source: Path):
150+
self._path = source
150151

151152
if not self._path.is_file() or not self._path.exists():
152153
raise FileNotFoundError(source)
@@ -653,7 +654,7 @@ def from_file(cls, path: PathLike[str] | str) -> DBNStore:
653654
If an empty file is specified.
654655
655656
"""
656-
return cls(FileDataSource(path))
657+
return cls(FileDataSource(validate_path(path, "path")))
657658

658659
@classmethod
659660
def from_bytes(cls, data: BytesIO | bytes | IO[bytes]) -> DBNStore:

databento/common/symbology.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from databento_dbn import SymbolMappingMsgV1
2424

2525
from databento.common.parsing import datetime_to_unix_nanoseconds
26+
from databento.common.validation import validate_path
2627

2728

2829
class MappingInterval(NamedTuple):
@@ -49,15 +50,15 @@ def _validate_path_pair(
4950
in_file: PathLike[str] | str,
5051
out_file: PathLike[str] | str | None,
5152
) -> tuple[Path, Path]:
52-
in_file_valid = Path(in_file)
53+
in_file_valid = validate_path(in_file, "in_file")
5354

5455
if not in_file_valid.exists():
5556
raise ValueError(f"{in_file_valid} does not exist")
5657
if not in_file_valid.is_file():
5758
raise ValueError(f"{in_file_valid} is not a file")
5859

5960
if out_file is not None:
60-
out_file_valid = Path(out_file)
61+
out_file_valid = validate_path(out_file, "out_file")
6162
else:
6263
out_file_valid = in_file_valid.with_name(
6364
f"{in_file_valid.stem}_mapped{in_file_valid.suffix}",

databento/common/types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import datetime as dt
22
import logging
3-
import pathlib
43
import warnings
54
from collections.abc import Callable
65
from os import PathLike
@@ -13,6 +12,7 @@
1312
import pandas as pd
1413

1514
from databento.common.error import BentoWarning
15+
from databento.common.validation import validate_file_write_path
1616

1717

1818
logger = logging.getLogger(__name__)
@@ -110,7 +110,7 @@ def __init__(
110110
is_managed = False
111111

112112
if isinstance(stream, (str, PathLike)):
113-
stream = pathlib.Path(stream).open("xb")
113+
stream = validate_file_write_path(stream, "stream", False).open("xb")
114114
is_managed = True
115115

116116
if not hasattr(stream, "write"):

databento/common/validation.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020

2121
def validate_path(value: PathLike[str] | str, param: str) -> Path:
2222
"""
23-
Validate whether the given value is a valid path.
23+
Validate whether the given value is a valid path. This also expands user
24+
directories to form valid paths.
2425
2526
Parameters
2627
----------
@@ -38,10 +39,12 @@ def validate_path(value: PathLike[str] | str, param: str) -> Path:
3839
------
3940
TypeError
4041
If value is not a valid path.
42+
RuntimeError
43+
If a user's home directory cannot be expanded.
4144
4245
"""
4346
try:
44-
return Path(value)
47+
return Path(value).expanduser()
4548
except TypeError:
4649
raise TypeError(
4750
f"The `{param}` was not a valid path type. " "Use any of [PathLike[str], str].",
@@ -72,6 +75,10 @@ def validate_file_write_path(
7275
7376
Raises
7477
------
78+
TypeError
79+
If value is not a valid path.
80+
RuntimeError
81+
If a user's home directory cannot be expanded.
7582
IsADirectoryError
7683
If path is a directory.
7784
FileExistsError

databento/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.67.0"
1+
__version__ = "0.68.0"

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "databento"
3-
version = "0.67.0"
3+
version = "0.68.0"
44
description = "Official Python client library for Databento"
55
readme = "README.md"
66
requires-python = ">=3.10"
@@ -10,7 +10,7 @@ dynamic = [ "classifiers" ]
1010
dependencies = [
1111
"aiohttp>=3.8.3,<4.0.0; python_version < '3.12'",
1212
"aiohttp>=3.9.0,<4.0.0; python_version >= '3.12'",
13-
"databento-dbn~=0.44.0",
13+
"databento-dbn~=0.45.0",
1414
"numpy>=1.23.5; python_version < '3.12'",
1515
"numpy>=1.26.0; python_version >= '3.12'",
1616
"pandas>=1.5.3",
@@ -42,7 +42,7 @@ classifiers = [
4242
]
4343

4444
[tool.poetry.dependencies]
45-
python = ">=3.10,<3.14"
45+
python = ">=3.10,<3.15"
4646

4747
[tool.poetry.group.dev.dependencies]
4848
black = "^23.9.1"

0 commit comments

Comments
 (0)