-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[9/n][dagster-fivetran] Implement sync and poll methods in FivetranClient #25911
base: maxime/rework-fivetran-8
Are you sure you want to change the base?
Conversation
FivetranWorkspaceData
to FivetranConnectorTableProps
method
#25797
def update_schedule_type( | ||
self, connector_id: str, schedule_type: Optional[str] = None | ||
) -> Mapping[str, Any]: | ||
"""Updates the schedule type property of the connector to either "auto" or "manual". | ||
Args: | ||
connector_id (str): The Fivetran Connector ID. You can retrieve this value from the | ||
"Setup" tab of a given connector in the Fivetran UI. | ||
schedule_type (Optional[str]): Either "auto" (to turn the schedule on) or "manual" (to | ||
turn it off). | ||
Returns: | ||
Dict[str, Any]: Parsed json data representing the API response. | ||
""" | ||
if schedule_type not in ["auto", "manual"]: | ||
check.failed(f"schedule_type must be either 'auto' or 'manual': got '{schedule_type}'") | ||
return self.update_connector(connector_id, properties={"schedule_type": schedule_type}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The schedule_type
parameter is marked as Optional[str]
but the validation logic will raise an error if None
is passed. Consider either removing the Optional
type hint or adding a None
check before the schedule_type
validation to align the type hints with the actual behavior.
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
Summary & Motivation
How I Tested These Changes
Changelog