dirkrkotzeml commented on code in PR #45551:
URL: https://github.com/apache/airflow/pull/45551#discussion_r1914319806
##########
providers/src/airflow/providers/amazon/aws/operators/sagemaker.py:
##########
@@ -165,7 +165,13 @@ def _get_unique_name(
if fail_if_exists:
raise AirflowException(f"A SageMaker {resource_type} with name
{name} already exists.")
else:
- name = f"{proposed_name}-{time.time_ns()//1000000}"
+ timestamp = time.time_ns()//1000000
+ timestamp_length = len(timestamp)
+ name_length = len(name)
+ if 63 > name_length + timestamp_length + 1:
Review Comment:
Hi Ferruzzi, yeah sure thing sorry I overlooked my code where I cast it to a
string, I just followed the timestamp that AWS used in their other Sagemaker
code, the reason for the 63 length is that we are adding a dash between the
name and the timestamp therefor the suggested code returns a length of 65. I
like the approach that you took will update the branch. Thanks for the
suggestion!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]