Skip to content

Commit 5e889c1

Browse files
Require API key for get_ml_ready and update docs
1 parent 92daf0c commit 5e889c1

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ print(insight["summary"])
160160
#### `get_ml_ready(series_ids, align="inner", impute="ffill+median", features="default")`
161161

162162
Fetch multiple series, align on date, impute gaps, and add per-series features (lags, rolling stats, MoM/YoY %, z-score).
163+
Requires API key on a paid plan.
163164

164165
```python
165166
df = iq.get_ml_ready(

datasetiq/features.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
import pandas as pd
1010

1111
from .client import get
12+
from .config import get_config
13+
from .exceptions import AuthenticationError
1214

1315
SeriesLike = Union[str, pd.DataFrame, pd.Series]
1416

@@ -234,6 +236,10 @@ def get_ml_ready(
234236
Returns:
235237
DataFrame with aligned base columns and optional engineered features.
236238
"""
239+
config = get_config()
240+
if not config.api_key:
241+
raise AuthenticationError("get_ml_ready requires an API key on a paid plan.")
242+
237243
join_how = "inner" if align == "inner" else "outer"
238244
frames = []
239245
for series_id in series_ids:

tests/test_features.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def test_get_insight_dataframe():
3737

3838
def test_get_ml_ready_with_features(monkeypatch):
3939
df = _sample_df()
40+
iq.configure(api_key="test-key")
4041

4142
def fake_get(series_id, *args, **kwargs):
4243
return df.rename(columns={"value": "value"})

0 commit comments

Comments
 (0)