Skip to content

Commit

Permalink
Store setup state as string
Browse files Browse the repository at this point in the history
  • Loading branch information
maximearmstrong committed Nov 14, 2024
1 parent cb68de7 commit a8daee3
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class FivetranConnectorTableProps(NamedTuple):
service: Optional[str]


@whitelist_for_serdes
class FivetranConnectorSetupStateType(Enum):
"""Enum representing each setup state for a connector in Fivetran's ontology."""

Expand All @@ -38,7 +37,7 @@ class FivetranConnector:
name: str
service: str
group_id: str
setup_state: FivetranConnectorSetupStateType
setup_state: str

@property
def url(self) -> str:
Expand All @@ -50,7 +49,7 @@ def destination_id(self) -> str:

@property
def is_connected(self) -> bool:
return self.setup_state is FivetranConnectorSetupStateType.CONNECTED
return self.setup_state == FivetranConnectorSetupStateType.CONNECTED.value

@classmethod
def from_connector_details(
Expand All @@ -62,7 +61,7 @@ def from_connector_details(
name=connector_details["schema"],
service=connector_details["service"],
group_id=connector_details["group_id"],
setup_state=FivetranConnectorSetupStateType(connector_details["status"]["setup_state"]),
setup_state=connector_details["status"]["setup_state"],
)


Expand Down

0 comments on commit a8daee3

Please sign in to comment.