Spaces:
Paused
Paused
Download scratch/verify_mappers.py from TeamError404/nexus: direct link, hf CLI and curl.
- Browser
- Download file 1.16 kB
-
https://huggingface.co/spaces/TeamError404/nexus/resolve/main/scratch/verify_mappers.py
- Command line
-
hf download hf://spaces/TeamError404/nexus/scratch/verify_mappers.py
-
curl -L -o verify_mappers.py https://huggingface.co/spaces/TeamError404/nexus/resolve/main/scratch/verify_mappers.py
1.16 kB
| import asyncio | |
| import os | |
| import sys | |
| # Ensure local imports work | |
| sys.path.append(os.getcwd()) | |
| from core.database import async_session_factory | |
| from sqlalchemy import select | |
| from models.ticket import Ticket | |
| from models.nexus_memory import NexusMemory | |
| async def test_mapper_init(): | |
| print("Testing SQLAlchemy Mapper Initialization...") | |
| async with async_session_factory() as db: | |
| try: | |
| # This will trigger mapper initialization | |
| stmt = select(Ticket).limit(1) | |
| await db.execute(stmt) | |
| print("OK: Ticket mapper initialized successfully.") | |
| stmt2 = select(NexusMemory).limit(1) | |
| await db.execute(stmt2) | |
| print("OK: NexusMemory mapper initialized successfully.") | |
| print("SUCCESS: ALL MAPPERS INITIALIZED SUCCESSFULLY.") | |
| except Exception as e: | |
| print(f"FAIL: Mapper Initialization FAILED!") | |
| print(f"Error Type: {type(e).__name__}") | |
| print(f"Error Message: {str(e)}") | |
| import traceback | |
| traceback.print_exc() | |
| if __name__ == "__main__": | |
| asyncio.run(test_mapper_init()) | |