eladkal commented on code in PR #27634:
URL: https://github.com/apache/airflow/pull/27634#discussion_r1029335857


##########
airflow/providers/amazon/aws/hooks/sagemaker.py:
##########
@@ -954,33 +955,49 @@ def find_processing_job_by_name(self, 
processing_job_name: str) -> bool:
         )
         return bool(self.count_processing_jobs_by_name(processing_job_name))
 
+    @staticmethod
+    def _name_matches_pattern(
+        processing_job_name: str,
+        found_name: str,
+        job_name_suffix: str | None = None,
+    ) -> bool:
+        pattern = re.compile(f"^{processing_job_name}({job_name_suffix})?$")
+        return pattern.fullmatch(found_name) is not None
+
     def count_processing_jobs_by_name(
         self,
         processing_job_name: str,
+        job_name_suffix: str | None = None,
         throttle_retry_delay: int = 2,
         retries: int = 3,
     ) -> int:
         """
         Returns the number of processing jobs found with the provided name 
prefix.
         :param processing_job_name: The prefix to look for.
+        :param job_name_suffix: The optional suffix which may be appended to 
dedupe an existing job name.

Review Comment:
   ```suggestion
           :param job_name_suffix: The optional suffix which may be appended to 
deduplicate an existing job name.
   ```



-- 
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]

Reply via email to