ginone commented on code in PR #45634:
URL: https://github.com/apache/airflow/pull/45634#discussion_r1919703513


##########
providers/src/airflow/providers/dbt/cloud/hooks/dbt.py:
##########
@@ -411,6 +466,72 @@ def get_job(self, job_id: int, account_id: int | None = 
None) -> Response:
         """
         return 
self._run_and_get_response(endpoint=f"{account_id}/jobs/{job_id}")
 
+    @fallback_to_default_account
+    def get_job_by_name(
+        self, project_name: str, environment_name: str, job_name: str, 
account_id: int | None = None
+    ) -> dict:
+        """
+        Retrieve metadata for a specific job by combination of project, 
environment, and job name.
+
+        Raises AirflowException if the job is not found or cannot be uniquely 
identified by provided parameters.
+
+        :param project_name: The name of a dbt Cloud project.
+        :param environment_name: The name of a dbt Cloud environment.
+        :param job_name: The name of a dbt Cloud job.
+        :param account_id: Optional. The ID of a dbt Cloud account.
+        :return: The details of a job.
+        """
+        # get project_id using project_name
+        projects = self.list_projects(name_contains=project_name, 
account_id=account_id)

Review Comment:
   Thanks for catching that! I've improved the clarity by renaming variables 
and enhancing comments



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to