fivetran / prefect-fivetran

https://fivetran.github.io/prefect-fivetran/
Apache License 2.0
14 stars 4 forks source link

trigger_fivetran_connector_sync_and_wait_for_completion throws errors... #15

Open Bryan-Meier opened 10 months ago

Bryan-Meier commented 10 months ago

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!