justinpakzad commented on code in PR #76106:
URL: https://github.com/apache/airflow/pull/76106#discussion_r4687874925
##########
providers/snowflake/src/airflow/providers/snowflake/operators/snowpark_containers.py:
##########
@@ -187,11 +214,24 @@ def _build_sql(self) -> str:
sql += f" FROM {self.spec_stage} SPEC = '{self.spec}'"
return sql
- def _run_one(self, sql: str, return_dictionaries: bool = False) -> Any:
+ def _run_one(
+ self, sql: str, return_dictionaries: bool = False, parameters:
dict[str, Any] | None = None
+ ) -> Any:
"""Run a single statement that returns one row via
fetch_one_handler."""
- return self._hook.run(sql, handler=fetch_one_handler,
return_dictionaries=return_dictionaries)
+ return self._hook.run(
+ sql, parameters=parameters, handler=fetch_one_handler,
return_dictionaries=return_dictionaries
+ )
- def _submit_job(self) -> str:
+ def _describe_status(self, external_id: JsonValue) -> str:
+ """Describe the job's current status."""
+ response = self._run_one(
+ "DESCRIBE SERVICE IDENTIFIER(%(job_name)s)",
+ return_dictionaries=True,
+ parameters={"job_name": external_id},
+ )
+ return response.get("status")
+
+ def submit_job(self, context: Context) -> str:
Review Comment:
Added a note in the changelog.
--
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]