Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename function.get_jobs to function.jobs and make it return Job objects #1480

Merged
merged 15 commits into from
Sep 11, 2024

Conversation

akihikokuroda
Copy link
Collaborator

@akihikokuroda akihikokuroda commented Aug 29, 2024

Summary

fix #1479
fix #1463

Details and comments

@akihikokuroda
Copy link
Collaborator Author

By importing the Job in the Function, it caused a circular dependency. I had to workaround by putting the import inside of the method. We probably need to refactor the client file structure.

client/qiskit_serverless/core/function.py Show resolved Hide resolved
gateway/api/views.py Outdated Show resolved Hide resolved
gateway/api/serializers.py Outdated Show resolved Hide resolved
client/.pylintrc Show resolved Hide resolved
gateway/api/serializers.py Outdated Show resolved Hide resolved
gateway/api/views.py Outdated Show resolved Hide resolved
client/qiskit_serverless/core/function.py Show resolved Hide resolved
Copy link
Member

@IceKhan13 IceKhan13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is ok for now. Reason why it is happening is function and job files are located in the same level in different files, therefore python is trying to initialize first file with reference to another file without being initialized. And you have circular references (one is referring to another in a cycle).

Later on solution will be to move Job class to higher level and refer job from function and job_client files.

@@ -118,7 +118,7 @@ def run(self, **kwargs):
config=config,
)

def get_jobs(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something that we probably should do before merge is to add a deprecation warning here instead to remove it. Just to avoid a breaking change in the catalog until we release a new version.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can create an additional PR solving this.

@Tansito Tansito self-requested a review September 10, 2024 23:38
@Tansito Tansito merged commit be6123b into Qiskit:main Sep 11, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Client: rename get_jobs to jobs in QiskitFunction Consistent get_jobs() return type
3 participants