import asyncio import logging import sys import os # Add backend directory to path sys.path.append(os.path.join(os.getcwd(), "backend")) from app.database import AsyncSessionLocal from sqlalchemy import select from app.models.db.celestial_body import CelestialBody logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) async def check_data(): async with AsyncSessionLocal() as session: # Check Earth and Jupiter stmt = select(CelestialBody).where(CelestialBody.name.in_(['Earth', 'Jupiter'])) result = await session.execute(stmt) bodies = result.scalars().all() print(f"Found {len(bodies)} bodies.") for body in bodies: print(f"Body: {body.name} (ID: {body.id})") print(f" Extra Data (Raw): {body.extra_data}") if body.extra_data: print(f" Real Radius: {body.extra_data.get('real_radius')}") else: print(" Extra Data is None/Empty") if __name__ == "__main__": asyncio.run(check_data())