|
22 | 22 | from contextlib import asynccontextmanager |
23 | 23 | from datetime import datetime |
24 | 24 | from importlib import resources as importlib_resources |
| 25 | +from types import SimpleNamespace |
25 | 26 | from typing import Any, DefaultDict, Dict, List, NamedTuple, Optional, Union |
26 | 27 |
|
27 | 28 | import pandas as pd |
@@ -212,13 +213,28 @@ def get_app( |
212 | 213 | fs_cfg = getattr(store.config, "feature_server", None) |
213 | 214 | batching_cfg = None |
214 | 215 | if fs_cfg is not None: |
215 | | - batching_cfg = getattr(fs_cfg, "offline_write_batching", None) |
| 216 | + enabled = getattr(fs_cfg, "offline_push_batching_enabled", None) |
| 217 | + batch_size = getattr(fs_cfg, "offline_push_batching_batch_size", None) |
| 218 | + batch_interval_seconds = getattr( |
| 219 | + fs_cfg, "offline_push_batching_batch_interval_seconds", None |
| 220 | + ) |
| 221 | + |
| 222 | + if ( |
| 223 | + enabled is not None |
| 224 | + or batch_size is not None |
| 225 | + or batch_interval_seconds is not None |
| 226 | + ): |
| 227 | + batching_cfg = SimpleNamespace( |
| 228 | + enabled=bool(enabled) if enabled is not None else False, |
| 229 | + batch_size=batch_size if batch_size is not None else 100, |
| 230 | + batch_interval_seconds=batch_interval_seconds |
| 231 | + if batch_interval_seconds is not None |
| 232 | + else 1, |
| 233 | + ) |
216 | 234 |
|
217 | 235 | offline_batcher: Optional[OfflineWriteBatcher] = None |
218 | 236 | enabled = getattr(batching_cfg, "enabled", False) |
219 | 237 | if batching_cfg is not None and isinstance(enabled, bool) and enabled is True: |
220 | | - offline_batcher = OfflineWriteBatcher(store=store, cfg=batching_cfg) |
221 | | - |
222 | 238 | offline_batcher = OfflineWriteBatcher(store=store, cfg=batching_cfg) |
223 | 239 | logger.debug("Offline write batching is ENABLED") |
224 | 240 | else: |
|
0 commit comments