Skip to content

Conversation

@MattWellie
Copy link
Contributor

The production-pipelines implementation (here) had the method signature:

def set_resources(
        self,
        j: Job,
        fraction: float | None = None,

That method signature was changed in the liftover to:

def set_resources(
        self,
        *,
        j: Job,
        fraction: float | None = None,
        ...

Most/all of the uses of this method in code had the job as the first argument, often without keyword, e.g.

res = STANDARD.set_resources(j, ncpu=nthreads, storage_gb=50)

This syntax is no longer valid in CPG-Flow, as the * consumes the job parameter unless it is supplied with a keyword, giving the error:

TypeError: MachineType.set_resources() takes 1 positional argument but 2 positional arguments (and 2 keyword-only arguments) were given

This PR proposes changing back to the original syntax and removing the non-keyword argument consumer, as I can't see why the * was added.

@cpg-software-ci-bot
Copy link
Contributor

📊 SonarQube Summary

Metric This PR Main Branch
✅ Coverage 76.3% 76.3%
💨 Code Smells 47 47
🐞 Bugs 0 0
🔐 Vulnerabilities 0 0
🚨 Security Hotspots 1 0
📝 New Issues 0 0
🌟 Quality Gate ✅ OK ✅ OK

🔗 View Main Branch Report
🔗 View PR Report

@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2025

🐳 Docker Image Built

A new Docker image has been built for this PR:

Image: australia-southeast1-docker.pkg.dev/cpg-common/images-dev/cpg_flow:217a2f138490bdf906b6e28dc6c28a90842adb7d

Pull command:

docker pull australia-southeast1-docker.pkg.dev/cpg-common/images-dev/cpg_flow:217a2f138490bdf906b6e28dc6c28a90842adb7d

🔗 View in Google Cloud Console


This comment was automatically generated by the Docker workflow.

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