Skip to content

Commit

Permalink
Set correct session state when encountering EntityNotFound
Browse files Browse the repository at this point in the history
  • Loading branch information
Firth, Charlie committed Jan 31, 2025
1 parent d8259f9 commit f8011ea
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dbt/adapters/glue/gluedbapi/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,12 @@ def state(self) -> str:
session = response.get("Session", {})
self._state = session.get("Status")
except Exception as e:
if isinstance(e, botocore.exceptions.ClientError):
if e.response['Error']['Code'] == 'EntityNotFoundException':
logger.debug(f"Session {self.session_id} not found")
logger.debug(e)
self._state = None
return self._state
logger.debug(f"Error while checking state of session {self.session_id}")
logger.debug(e)
self._state = GlueSessionState.STOPPED
Expand Down

0 comments on commit f8011ea

Please sign in to comment.