fivetran / fivetran/prefect-fivetran
trigger_fivetran_connector_sync_and_wait_for_completion throws errors...
- Dominant language
- Python
- Stars
- 14
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
I am assuming this is the case for the other functions as well but when I use the code:
```
import asyncio
from prefect import flow
from prefect_fivetran import FivetranCredentials
from prefect_fivetran.connectors import trigger_fivetran_connector_sync_and_wait_for_completion
@flow
async def my_flow():
...
fivetran_credentials = FivetranCredentials(
api_key="my_api_key",
api_secret="my_secret",
)
fivetran_result = await trigger_fivetran_connector_sync_and_wait_for_completion(
fivetran_credentials=fivetran_credentials,
connector_id="my_connector_id",
poll_status_every_n_seconds=30,
)
...
results = asyncio.run(my_flow())
```
I get the following error:
```
10:34:25.545 | INFO | Flow run 'astute-horse' - Created subflow run 'grinning-parrot' for flow 'Trigger Fivetran connector sync and wait for completion'
10:34:25.546 | INFO | Flow run 'grinning-parrot' - View at https://app.prefect.cloud/account/xyz/workspace/abc/flow-runs/flow-run/xyzabc123
10:34:25.551 | ERROR | Flow run 'grinning-parrot' - Validation of flow parameters failed with error:
Traceback (most recent call last):
File "C:\src\Python\Prefect\test-workspace\env\lib\site-packages\prefect\engine.py", line 647, in create_and_begin_subflow_run
parameters = flow.validate_parameters(parameters)
File "C:\src\Python\Prefect\test-workspace\env\lib\site-packages\prefect\flows.py", line 475, in validate_parameters
model = validated_fn.init_model_instance(*args, **kwargs)
File "C:\src\Python\Prefect\test-workspace\env\lib\site-packages\pydantic\v1\decorator.py", line 130, in init_model_instance
return self.model(**values)
File "C:\src\Python\Prefect\test-workspace\env\lib\site-packages\pydantic\main.py", line 164, in __init__
__pydantic_self__.__pydantic_validator__.validate_python(data, self_instance=__pydantic_self__)
TypeError: BaseModel.validate() takes 2 positional arguments but 3 were given
10:34:25.762 | ERROR | Flow run 'grinning-parrot' - Finished in state Failed('Validation of flow parameters failed with error: TypeError: BaseModel.validate() takes 2 positional arguments but 3 were given')
```
I am not certain on how to fix or get around the issue. Any help is greatly appreciated! Thanks all!
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the failure from the issue's Python example and inspect trigger_fivetran_connector_sync_and_wait_for_completion, along with the other connector functions mentioned. Trace flow-parameter validation and dependency compatibility; done means the connector flow accepts FivetranCredentials without the reported TypeError and the behavior is covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100