PrefectHQ / prefect-airbyte

https://PrefectHQ.github.io/prefect-airbyte/
Apache License 2.0
40 stars 7 forks source link

Update example in export_configuration task #15

Closed serinamarie closed 2 years ago

serinamarie commented 2 years ago

I don't have write access to this repo but it would be great if the example in the export_configuration() task could be updated so that it is functional, like so:

import gzip
from prefect import flow, task
from prefect_airbyte.configuration import export_configuration

@task
def zip_and_write_somewhere(
    airbyte_config: bytearray, 
    somewhere: str = 'my_destination.gz'
    ):

    with gzip.open(somewhere, 'wb') as f:
        f.write(airbyte_config)

@flow
def example_export_configuration_flow():
    # Run other tasks and subflows here
    airbyte_config = export_configuration(
        airbyte_server_host="localhost",
        airbyte_server_port="8000",
        airbyte_api_version="v1",
      )
    zip_and_write_somewhere(airbyte_config=airbyte_config)

example_export_configuration_flow()

instead of

import gzip
from prefect import flow, task
from prefect_airbyte.configuration import export_configuration

@task
def zip_and_write_somewhere(
    airbyte_config: bytearray
    somwhere: str = 'my_destination.gz','
):
    with gzip.open('my_destination.gz', 'wb') as f:
        f.write(airbyte_configuration)

@flow
def example_export_configuration_flow():
    # Run other tasks and subflows here
    airbyte_config = export_configuration(
          airbyte_server_host="localhost",
          airbyte_server_port="8000",
          airbyte_api_version="v1",
    )
    zip_and_write_somewhere(airbyte_config=airbyte_config)

example_trigger_sync_flow()
zzstoatzz commented 2 years ago

@serinamarie thanks for the issue! example in docstring has been updated and PyPI docs will be updated accordingly on release!