anderson-ufrj
commited on
Commit
·
8cfbcd3
1
Parent(s):
3e7de94
fix(imports): correct cache imports in geographic and visualization routes
Browse files- Fix CacheService import path from core.cache to services.cache_service
- Replace CacheKey usage with simple string cache keys
- Remove non-existent CacheKey class references
src/api/routes/geographic.py
CHANGED
|
@@ -14,7 +14,7 @@ from sqlalchemy.ext.asyncio import AsyncSession
|
|
| 14 |
from src.agents.lampiao import LampiaoAgent, RegionType
|
| 15 |
from src.core.auth import get_current_user
|
| 16 |
from src.core.database import get_db
|
| 17 |
-
from src.
|
| 18 |
from src.core.rate_limit import RateLimiter, rate_limit
|
| 19 |
from src.core import get_logger
|
| 20 |
from src.services.agent_lazy_loader import AgentLazyLoader
|
|
@@ -195,10 +195,7 @@ async def get_geographic_boundaries(
|
|
| 195 |
Currently supports state-level boundaries with plans to add municipalities.
|
| 196 |
"""
|
| 197 |
try:
|
| 198 |
-
cache_key =
|
| 199 |
-
prefix="geo_boundaries",
|
| 200 |
-
params={"region_type": region_type.value, "simplified": simplified}
|
| 201 |
-
)
|
| 202 |
|
| 203 |
# Try to get from cache
|
| 204 |
cached_data = await cache_service.get(cache_key)
|
|
|
|
| 14 |
from src.agents.lampiao import LampiaoAgent, RegionType
|
| 15 |
from src.core.auth import get_current_user
|
| 16 |
from src.core.database import get_db
|
| 17 |
+
from src.services.cache_service import CacheService
|
| 18 |
from src.core.rate_limit import RateLimiter, rate_limit
|
| 19 |
from src.core import get_logger
|
| 20 |
from src.services.agent_lazy_loader import AgentLazyLoader
|
|
|
|
| 195 |
Currently supports state-level boundaries with plans to add municipalities.
|
| 196 |
"""
|
| 197 |
try:
|
| 198 |
+
cache_key = f"geo_boundaries:{region_type.value}:{simplified}"
|
|
|
|
|
|
|
|
|
|
| 199 |
|
| 200 |
# Try to get from cache
|
| 201 |
cached_data = await cache_service.get(cache_key)
|
src/api/routes/visualization.py
CHANGED
|
@@ -20,7 +20,7 @@ from src.agents.oscar_niemeyer import (
|
|
| 20 |
from src.agents.lampiao import LampiaoAgent, RegionType
|
| 21 |
from src.core.auth import get_current_user
|
| 22 |
from src.core.database import get_db
|
| 23 |
-
from src.
|
| 24 |
from src.core.rate_limit import RateLimiter, rate_limit
|
| 25 |
from src.core import get_logger
|
| 26 |
from src.services.agent_lazy_loader import AgentLazyLoader
|
|
|
|
| 20 |
from src.agents.lampiao import LampiaoAgent, RegionType
|
| 21 |
from src.core.auth import get_current_user
|
| 22 |
from src.core.database import get_db
|
| 23 |
+
from src.services.cache_service import CacheService
|
| 24 |
from src.core.rate_limit import RateLimiter, rate_limit
|
| 25 |
from src.core import get_logger
|
| 26 |
from src.services.agent_lazy_loader import AgentLazyLoader
|