Skip to content

Commit cd5a2dd

Browse files
authored
Remove dependency to polars (#991)
It is just too big (28MB) to have only to validate one code example. Instead we leave the line that uses polars as a comment.
2 parents 249d4fe + 4e7aedc commit cd5a2dd

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

pyproject.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ dev-flake8 = [
4949
"pydoclint == 0.4.1",
5050
"pydocstyle == 6.3.0",
5151
]
52-
dev-examples = ["polars == 0.20.31"]
5352
dev-formatting = ["black == 24.4.2", "isort == 5.13.2"]
5453
dev-mkdocs = [
5554
"black == 24.4.2",
@@ -83,8 +82,6 @@ dev-pytest = [
8382
"pytest-asyncio == 0.23.7",
8483
"time-machine == 2.12.0",
8584
"async-solipsism == 0.6",
86-
# For checking docstring code examples
87-
"frequenz-sdk[dev-examples]",
8885
"hypothesis == 6.103.1",
8986
]
9087
dev = [

src/frequenz/sdk/timeseries/_moving_window.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ async def run() -> None:
9393
Example: Create a polars data frame from a `MovingWindow`
9494
9595
```python
96-
import polars as pl
9796
from datetime import datetime, timedelta, timezone
9897
9998
async def send_mock_data(sender: Sender[Sample]) -> None:
@@ -118,10 +117,12 @@ async def run() -> None:
118117
# wait for one full day until the buffer is filled
119118
await asyncio.sleep(60*60*24)
120119
121-
# create a polars series with one full day of data
122120
time_start = datetime(2023, 1, 1, tzinfo=timezone.utc)
123121
time_end = datetime(2023, 1, 2, tzinfo=timezone.utc)
124-
series = pl.Series("Jan_1", window[time_start:time_end])
122+
123+
# You can now create a polars series with one full day of data by
124+
# passing the window slice, like:
125+
# series = pl.Series("Jan_1", window[time_start:time_end])
125126
126127
asyncio.run(run())
127128
```

0 commit comments

Comments
 (0)