Closed jamescavanagh closed 1 month ago
@tspence The Python API throws an error due to a simple typo. I fixed it last week so it doesn't affect me, but you may want to fix it for backwards compatibility
@tspence would you like a hand? Would you like for me to help and submit a pull request?
Thanks for the problem report! Yes, we indeed welcome pull requests. I do use an automated SDK generator as well as some basic type checking so I'm curious why this particular issue wasn't caught. I'd like to both solve it and fix the SDK generator so it doesn't have this same problem again.
I am researching now, but if you have a PR that's easy to send I would love to land it!
I've updated the code generator so it won't build nested references with #26
Found another typo, fixed it myself
there's an error that can be fixed by commenting out this circular import in
models.notificationdto
from future import annotations from ProjectManagerSdk.models.notificationdatadto import NotificationDataDto #from ProjectManagerSdk.models.notificationdto import NotificationDto from typing import List import dataclasses
{ "name": "ImportError", "message": "cannot import name 'NotificationDto' from partially initialized module 'ProjectManagerSdk.models.notificationdto' (most likely due to a circular import) (/home/jentlejames/miniconda3/envs/py310/lib/python3.10/site-packages/ProjectManagerSdk/models/notificationdto.py)", "stack": "--------------------------------------------------------------------------- ImportError Traceback (most recent call last) Cell In[5], line 1 ----> 1 import ProjectManagerSdk 2 from typing import Union, List, Dict 4 import pandas as pd
File ~/miniconda3/envs/py310/lib/python3.10/site-packages/ProjectManagerSdk/init.py:17 15 from ProjectManagerSdk.clients.licenseclient import LicenseClient 16 from ProjectManagerSdk.clients.meclient import MeClient ---> 17 from ProjectManagerSdk.clients.notificationclient import NotificationClient 18 from ProjectManagerSdk.clients.nptfilesclient import NptFilesClient 19 from ProjectManagerSdk.clients.projectclient import ProjectClient
File ~/miniconda3/envs/py310/lib/python3.10/site-packages/ProjectManagerSdk/clients/notificationclient.py:15 1 # 2 # ProjectManager API for Python 3 # (...) 11 # @link https://github.com/projectmgr/projectmanager-sdk-python 12 # 14 from ProjectManagerSdk.models.astroresult import AstroResult ---> 15 from ProjectManagerSdk.models.notificationresponsedto import NotificationResponseDto 16 from ProjectManagerSdk.models.notificationtimestampdto import NotificationTimestampDto 17 from ProjectManagerSdk.models.notificationtotalcountdto import NotificationTotalCountDto
File ~/miniconda3/envs/py310/lib/python3.10/site-packages/ProjectManagerSdk/models/notificationresponsedto.py:15 1 # 2 # ProjectManager API for Python 3 # (...) 11 # @link https://github.com/projectmgr/projectmanager-sdk-python 12 # ---> 15 from ProjectManagerSdk.models.notificationdto import NotificationDto 16 from typing import List 17 import dataclasses
File ~/miniconda3/envs/py310/lib/python3.10/site-packages/ProjectManagerSdk/models/notificationdto.py:17 15 from future import annotations 16 from ProjectManagerSdk.models.notificationdatadto import NotificationDataDto ---> 17 from ProjectManagerSdk.models.notificationdto import NotificationDto 18 from typing import List 19 import dataclasses
ImportError: cannot import name 'NotificationDto' from partially initialized module 'ProjectManagerSdk.models.notificationdto' (most likely due to a circular import) (/home/jentlejames/miniconda3/envs/py310/lib/python3.10/site-packages/ProjectManagerSdk/models/notificationdto.py)" }