Skip to content

Commit

Permalink
Readme and attempt to fix delete dataset in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
j-bennet committed May 16, 2023
1 parent 8d82d92 commit c56eeb5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,16 @@ res = dask_bigquery.to_gbq(
With explicit credentials:

```python
import dask
import dask_bigquery
from google.oauth2.service_account import Credentials

ddf = dask.datasets.timeseries(freq="1min")

# credentials
creds_dict = {"type": ..., "project_id": ..., "private_key_id": ...}
credentials = Credentials.from_service_account_info(info=creds_dict)
credentials = Credentials.from_service_account_file("/home/<username>/google.json")

res = to_gbq(
res = dask_bigquery.to_gbq(
ddf,
project_id="my_project_id",
dataset_id="my_dataset_id",
Expand Down
9 changes: 3 additions & 6 deletions dask_bigquery/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,7 @@ def dataset():

yield dataset

bq_client.delete_dataset(
dataset=f"{project_id}.{dataset_id}",
delete_contents=True,
)
bq_client.delete_dataset(dataset=dataset, delete_contents=True)


@pytest.fixture(scope="module")
Expand All @@ -79,7 +76,7 @@ def table(dataset, df):
) # Make an API request.
job.result()

yield (project_id, dataset_id, table_id)
yield project_id, dataset_id, table_id


@pytest.fixture(scope="module")
Expand Down Expand Up @@ -109,7 +106,7 @@ def required_partition_filter_table(dataset, df):
table.require_partition_filter = True
bq_client.update_table(table, ["require_partition_filter"])

yield (project_id, dataset_id, table_id)
yield project_id, dataset_id, table_id


@pytest.fixture
Expand Down

0 comments on commit c56eeb5

Please sign in to comment.