Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

253
Views
El objeto fastapi 'Depende' no tiene atributo 'ejecutar'

Estaba tratando de llamar a una función asíncrona dentro de mi función de ruta asíncrona, recibí este error, the exception is 'Depends' object has no attribute 'execute' , la línea que causa el error fue company_specialization = await getCompanySpecialization() Me pregunto por qué puedo no hacer esto?!!

Esta es una parte del código.

enrutadores/empresa

 @router.get('/Company/{id}') async def getCompanyItem(id: int, db: Session = Depends(get_async_session)): try: query = select(Company).where(Company.id == id) results = await db.execute(query) data = results.scalars().first() if not data: raise HTTPException( status_code=404, detail="Utilisateur non trouvé" ) else: company_specialization = await getCompanySpecialization() return { "success": "True", 'data': data } except Exception as e: print("the exception is ", e) raise HTTPException( status_code=500, detail=f'Une erreur est survenue, veuillez réessayer ultérieurement.' )

controladores/empresa

 async def getCompanySpecialization(): return { "id": 1, "name": "ok" }
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!