KamranImaaz commented on PR #61008:
URL: https://github.com/apache/airflow/pull/61008#issuecomment-3805085497

   > > > we can replace RuntimeError with an Airflow Exception right?? for 
better logs and failures in UI
   > > > ```
   > > >  if instance is None:
   > > >             raise RuntimeError(f"Instance {instance_id} did not exist; 
unable to delete table {table_id}")
   > > >         
   > > >  table = instance.table(table_id=table_id)
   > > >  try:
   > > >      table.delete()
   > > >  except google.api_core.exceptions.NotFound:
   > > >      self.log.info("The table '%s' no longer exists. Consider it as 
deleted", table_id)
   > > > ```
   > > 
   > > 
   > > Please keep it as is - the tendency is to actually avoid usage of 
Airflow exceptions following a recent decision (see [dev list 
thread](https://lists.apache.org/thread/5rv4tz0oc27bgr4khx0on0jz8fpxvh55)).
   > 
   > Since you mentioned that to avoid usage of Airflow Exception as much as we 
can. Shall I remove this exception from here(which I added for better logs), 
Anyhow the task will fail and logs an error.
   > 
   > ```
   > `        cluster = Cluster(cluster_id, instance)
   >         # "reload" is required to set location_id attribute on cluster.
   >         try:
   >             cluster.reload()
   >         except google.api_core.exceptions.NotFound:
   >             raise AirflowException(
   >                 f"Dependency: cluster '{cluster_id}' does not exist for 
instance '{instance_id}'."
   >             )
   >         cluster.serve_nodes = nodes
   >         cluster.update()`
   > ```
   
   I am removing this exception in accordance with avoiding the usage of 
AirflowException.


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