Skip to content

Lambda helper doesn't update the lambda function code when using the function_arn parameter #3568

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

Closed
idanmoradarthas opened this issue Jan 5, 2023 · 1 comment
Labels
component: pipelines Relates to the SageMaker Pipeline Platform type: bug

Comments

@idanmoradarthas
Copy link

Describe the bug
We tested sagemaker.lambda_helper.Lambda with zipped_code_dir parameter and (and also with script parameter, but not together) using the parameter function_arn to identify the lambda function (as we created it outside of python code). We are using the Pipeline object from sagemaker but the function doesn't update the code when we upsert the pipeline code to sagemaker.

A workaround is to use the update() function. If this is an expected behavior and you need to use the update() function when using the parameter function_arn, it should be written in the documentation here: https://sagemaker.readthedocs.io/en/stable/api/utility/lambda_helper.html

To reproduce

func = Lambda(
    function_arn="arn:aws:lambda:[region]:[account_id]function:[function_name]",
    zipped_code_dir="lambda_helper.zip",
    handler="lambda_helper.lambda_handler",
    s3_bucket=sagemaker.Session().default_bucket()
)

The work around:

f_update_response = func.update()
print(f_update_response)

Expected behavior
The function will update the code when using upsert of the Pipeline object.

System information
A description of your system. Please provide:

  • SageMaker Python SDK version: 2.52.1. but the bug also reproduces on the latest sagemaker SDK Python version (2.126.0)
  • Python version: 3.9
  • CPU or GPU: CPU
  • Custom Docker image (Y/N): N
@rohangujarathi
Copy link
Member

Thank you for using SageMaker. The fix has been deployed to SageMaker Python SDK version v2.135.0. The issue should be resolved after upgrade.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pipelines Relates to the SageMaker Pipeline Platform type: bug
Projects
None yet
Development

No branches or pull requests

3 participants