示例#1
0
def extract_token_transfers_command(execution_date, **kwargs):
    with TemporaryDirectory() as tempdir:
        copy_from_export_path(export_path("logs", execution_date),
                              os.path.join(tempdir, "logs.json"))

        extract_token_transfers.callback(
            logs=os.path.join(tempdir, "logs.json"),
            batch_size=export_batch_size,
            output=os.path.join(tempdir, "token_transfers.csv"),
            max_workers=export_max_workers,
        )

        copy_to_export_path(
            os.path.join(tempdir, "token_transfers.csv"),
            export_path("token_transfers", execution_date),
        )
    def extract_token_transfers_command(execution_date, provider_uri,
                                        **kwargs):
        with TemporaryDirectory() as tempdir:
            copy_from_export_path(export_path("logs", execution_date),
                                  os.path.join(tempdir, "logs.json"))

            logging.info(
                'Calling extract_token_transfers(..., {}, ..., {})'.format(
                    export_batch_size, export_max_workers))
            extract_token_transfers.callback(
                logs=os.path.join(tempdir, "logs.json"),
                batch_size=export_batch_size,
                output=os.path.join(tempdir, "token_transfers.csv"),
                max_workers=export_max_workers,
            )

            copy_to_export_path(
                os.path.join(tempdir, "token_transfers.csv"),
                export_path("token_transfers", execution_date),
            )