<#4957 [BUG] Resource overrides doesn't works if t...
# flytekit
c
#4957 [BUG] Resource overrides doesn't works if the task is not defined in the same workflow file. Issue created by xshen8888 ### Describe the bug Resource overrides works if the task foo() is defined in the same workflow file. However, if I move the task foo() to another package (so that it’s shared and re-usable task), with_overrides() like below will not be effective. Do you experience this, and what is the solution? In another workflow file a.py:
Copy code
@task(
    requests=Resources(
        cpu="3",
        mem="3Gi",
    ),
)
def foo(...) -> None:
    ...

In my workflow file:
from a import foo
...
@workflow
def my_wf():
    foo(...).with_overrides(
        requests=Resources(
            cpu="5",
            mem="5Gi",
        ),
    )
Result: Task foo has been allocated resources cpu 3 & member 3Gi. ### Expected behavior Task foo should have been allocated resources cpu 5 & member 5Gi. ### Additional context to reproduce No response ### Screenshots No response ### Are you sure this issue hasn't been raised already? • Yes ### Have you read the Code of Conduct? • Yes flyteorg/flyte