-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
Sagemaker Operator Character limit fix #45551
Conversation
… SageMaker 64 character length constraint
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a unit test to cover that?
providers/src/airflow/providers/amazon/aws/operators/sagemaker.py
Outdated
Show resolved
Hide resolved
@ferruzzi @vincbeck We have updated the prior unit tests and added two of our own, the provider tests all pass. Just a small note the previous mock for time_ns was using an incorrect format that the time_ns() function would not return. In our updated function we limit the returned timestamp to 10 characters to capture only the date time up to the seconds as this is all that is needed. |
@dirkrkotzeml @eladkal @o-nikolas |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks exactly like how it is done on the SageMaker Pipelines SDK. Happy with it.
Looks like you just need to run your static checks. running |
Ran the checks now and pushed changes. Thanks @ferruzzi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Congrats on your first PR
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
Co-authored-by: Dirk Kotze <[email protected]> Co-authored-by: Rudolf Luttich <[email protected]> Co-authored-by: Rudolf07688 <[email protected]>
Co-authored-by: Dirk Kotze <[email protected]> Co-authored-by: Rudolf Luttich <[email protected]> Co-authored-by: Rudolf07688 <[email protected]>
… SageMaker 64 character length constraint
SageMakerProcessingJobs have a hard limit of 64 characters for the ProcessingJobName.
In the SageMakerBaseOperator there is a check for uniqueness for the name.
In the case that a name is not unique it adds a timestamp to prevent a potential collision, however there is no check to prevent the updated - from exceeding 64 characters. This causes the creation of the SageMakerProcessingJob to fail.
In the SageMaker Pipelines SDK they truncate the base name before adding the timestamp, therefor we took a similar approach for consistency purposes.
Closes: #45550