Skip to content

Commit

Permalink
feat: modify state option logic for success
Browse files Browse the repository at this point in the history
Signed-off-by: seolmin <[email protected]>
  • Loading branch information
stat-kwon committed Nov 5, 2024
1 parent a6ee520 commit 73b4eb7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,13 @@ def load(

if additional_labels := self.options.get("additional_labels"):
self._add_labels(additional_labels)

self.state = "AVAILABLE"
self.error_message = None

except Exception as e:
self.error_message = e.message if hasattr(e, "message") else str(e)
self.state = "UNAVAILABLE"
self.error_message = e.message if hasattr(e, "message") else str(e)
_LOGGER.error(f"[load] add {self.source_type} source error: {e}")

return self.df
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,13 @@ def load(
self.query_data_table(granularity, start, end, vars)
elif self.operator == "EVAL":
self.evaluate_data_table(granularity, start, end, vars)

self.state = "AVAILABLE"
self.error_message = None

except Exception as e:
self.error_message = e.message if hasattr(e, "message") else str(e)
self.state = "UNAVAILABLE"
self.error_message = e.message if hasattr(e, "message") else str(e)
_LOGGER.error(f"[load] {self.operator} operation error: {e}")

return self.df
Expand Down

0 comments on commit 73b4eb7

Please sign in to comment.