* This page is part of the Union.ai v2 docs.
* Full index: https://www.union.ai/docs/v2/union/llms.txt
* Union.ai is a commercial superset of the open-source Flyte project and uses the same `flyte` SDK and CLI, so questions about Flyte are usually answered here too.
* Only refer to the open-source Flyte docs if you are explicitly looking for information about the open-source Flyte project, particularly the open-source Flyte backend. The open-source Flyte v2 docs are at https://www.union.ai/docs/v2/flyte/llms.txt
* These are the v2 docs. v1 is out of date and deprecated. Only refer to v1 docs if asked explicitly about v1. The v1 index is at https://www.union.ai/docs/v1/union/llms.txt

# BigQueryConnector

**Package:** `flyteplugins.bigquery`

## Methods

| Method | Description |
|-|-|
| [`create()`](#create) | Return a resource meta that can be used to get the status of the task. |
| [`delete()`](#delete) | Delete the task. |
| [`get()`](#get) | Return the status of the task, and return the outputs in some cases. |
| [`get_logs()`](#get_logs) | Return the task execution logs. |
| [`get_metrics()`](#get_metrics) | Return the metrics for the task. |

### create()

```python
def create(
    task_template: flyteidl2.core.tasks_pb2.TaskTemplate,
    inputs: typing.Optional[typing.Dict[str, typing.Any]] = None,
    google_application_credentials: typing.Optional[str] = None,
    **kwargs,
) -> flyteplugins.bigquery.connector.BigQueryMetadata
```
Return a resource meta that can be used to get the status of the task.

| Parameter | Type | Description |
|-|-|-|
| `task_template` | `flyteidl2.core.tasks_pb2.TaskTemplate` | |
| `inputs` | `typing.Optional[typing.Dict[str, typing.Any]]` | |
| `google_application_credentials` | `typing.Optional[str]` | |
| `**kwargs` |  | |

### delete()

```python
def delete(
    resource_meta: flyteplugins.bigquery.connector.BigQueryMetadata,
    google_application_credentials: typing.Optional[str] = None,
    **kwargs,
)
```
Delete the task. This call should be idempotent. It should raise an error if fails to delete the task.

| Parameter | Type | Description |
|-|-|-|
| `resource_meta` | `flyteplugins.bigquery.connector.BigQueryMetadata` | |
| `google_application_credentials` | `typing.Optional[str]` | |
| `**kwargs` |  | |

### get()

```python
def get(
    resource_meta: flyteplugins.bigquery.connector.BigQueryMetadata,
    google_application_credentials: typing.Optional[str] = None,
    **kwargs,
) -> flyte.connectors._connector.Resource
```
Return the status of the task, and return the outputs in some cases. For example, bigquery job
can't write the structured dataset to the output location, so it returns the output literals to the propeller,
and the propeller will write the structured dataset to the blob store.

| Parameter | Type | Description |
|-|-|-|
| `resource_meta` | `flyteplugins.bigquery.connector.BigQueryMetadata` | |
| `google_application_credentials` | `typing.Optional[str]` | |
| `**kwargs` |  | |

### get_logs()

```python
def get_logs(
    resource_meta: ~M,
    **kwargs,
) -> typing.Union[typing.Coroutine[typing.Any, typing.Any, flyteidl2.connector.connector_pb2.GetTaskLogsResponse], typing.AsyncIterator[flyteidl2.connector.connector_pb2.GetTaskLogsResponse]]
```
Return the task execution logs. Populate `body.lines` (structured
LogLine entries with timestamp + originator) in the returned
GetTaskLogsResponse.

Overrides may be a plain async function returning a single
`GetTaskLogsResponse`, or an async generator yielding multiple
responses (preferred for paginated logs — the connector server
handles both shapes).

| Parameter | Type | Description |
|-|-|-|
| `resource_meta` | `~M` | |
| `**kwargs` |  | |

### get_metrics()

```python
def get_metrics(
    resource_meta: ~M,
    **kwargs,
) -> flyteidl2.connector.connector_pb2.GetTaskMetricsResponse
```
Return the metrics for the task.

| Parameter | Type | Description |
|-|-|-|
| `resource_meta` | `~M` | |
| `**kwargs` |  | |

---
**Source**: https://github.com/unionai/unionai-docs/blob/main/content/api-reference/integrations/bigquery/bigqueryconnector.md
**HTML**: https://www.union.ai/docs/v2/union/api-reference/integrations/bigquery/bigqueryconnector/
