Skip to content

PCVL-1255: rename global payload to cloud data - #788

Open
cmarsone wants to merge 11 commits into
Quandela:developfrom
cmarsone:PCVL-1255-rename-global-payload-to-cloud-data
Open

PCVL-1255: rename global payload to cloud data#788
cmarsone wants to merge 11 commits into
Quandela:developfrom
cmarsone:PCVL-1255-rename-global-payload-to-cloud-data

Conversation

@cmarsone

@cmarsone cmarsone commented Sep 1, 2026

Copy link
Copy Markdown

Rename variable and functions

cloud_data = {
“job_name”: str
“payload”: dict
}

@cmarsone
cmarsone requested a review from Aubaert September 1, 2026 14:32
@cmarsone cmarsone self-assigned this Sep 1, 2026
return PayloadGenerator.generate_cloud_data(command, experiment, params, platform_name, **kwargs)

@staticmethod
def generate_cloud_data(command: str,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is useless. While I agree that the method name above is wrong, this method is only used in deprecated methods anyway


@staticmethod
def generate_global_data(payload: Any, kwargs: dict = None) -> dict:
def generate_cloud_data_from_payload(payload: Any, kwargs: dict = None) -> dict:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You can remove the "from_payload". A cloud data is supposed to contain a payload in any case, so there is no need to precise it

self._custom_status_response = None
self._job_availability_response = {"max_jobs_in_queue": 1, "num_jobs_in_queue": 0}
self.last_payload = {}
responses.start()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Was it needed?

raise requests.HTTPError(f"Could not read json response from url: {endpoint}. \n{e}")

def post_request(self, endpoint: str, payload: dict | None) -> None | dict:
def post_request(self, endpoint: str, cloud_data: dict | None) -> None | dict:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Here, it can be any kind of data, not just the cloud_data

return response

def create_job(self, payload) -> str:
def create_job(self, payload: dict) -> str:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You can rename this argument for all the RPCHandlers. Also change the docstrings

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.

3 participants