Skip to content

Commit

Permalink
chore(python): run blacken session for all directories with a noxfile (
Browse files Browse the repository at this point in the history
…#262)

Source-Link: googleapis/synthtool@bc0de6e
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:39ad8c0570e4f5d2d3124a509de4fe975e799e2b97e0f58aed88f8880d5a8b60

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Nov 11, 2021
1 parent 57a4be9 commit 2ca0fb1
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 9 deletions.
8 changes: 4 additions & 4 deletions datacatalog/quickstart/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@

def temp_suffix():
now = datetime.datetime.now()
return "{}_{}".format(
now.strftime("%Y%m%d%H%M%S"), uuid.uuid4().hex[:8]
)
return "{}_{}".format(now.strftime("%Y%m%d%H%M%S"), uuid.uuid4().hex[:8])


@pytest.fixture(scope="session")
Expand All @@ -42,7 +40,9 @@ def bigquery_client(credentials, project_id):

@pytest.fixture(scope="session")
def default_credentials():
return google.auth.default(scopes=["https://www.googleapis.com/auth/cloud-platform"])
return google.auth.default(
scopes=["https://www.googleapis.com/auth/cloud-platform"]
)


@pytest.fixture(scope="session")
Expand Down
6 changes: 4 additions & 2 deletions datacatalog/quickstart/quickstart_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
import quickstart


def test_quickstart(capsys, client, project_id, dataset_id, table_id, random_tag_template_id):
def test_quickstart(
capsys, client, project_id, dataset_id, table_id, random_tag_template_id
):
location = "us-central1"
override_values = {
"project_id": project_id,
"dataset_id": dataset_id,
"table_id": table_id,
"tag_template_id": random_tag_template_id
"tag_template_id": random_tag_template_id,
}
tag_template_name = client.tag_template_path(
project_id, location, random_tag_template_id
Expand Down
2 changes: 1 addition & 1 deletion datacatalog/v1beta1/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def entry(client, entry_group_name):
type_=datacatalog_v1beta1.EntryType.DATA_STREAM,
name="samples_test_entry",
user_specified_system="sample_system",
)
),
)

entry = client.create_entry(request)
Expand Down
5 changes: 4 additions & 1 deletion datacatalog/v1beta1/get_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def sample_get_entry(
):
# [START data_catalog_get_entry_v1beta1]
from google.cloud import datacatalog_v1beta1

"""
Get Entry
Expand Down Expand Up @@ -59,7 +60,9 @@ def main():

parser = argparse.ArgumentParser()
parser.add_argument("--project_id", type_=str, default="[Google Cloud Project ID]")
parser.add_argument("--location_id", type_=str, default="[Google Cloud Location ID]")
parser.add_argument(
"--location_id", type_=str, default="[Google Cloud Location ID]"
)
parser.add_argument("--entry_group_id", type_=str, default="[Entry Group ID]")
parser.add_argument("--entry_id", type_=str, default="[Entry ID]")
args = parser.parse_args()
Expand Down
1 change: 1 addition & 0 deletions datacatalog/v1beta1/lookup_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
def sample_lookup_entry(resource_name: str):
# [START data_catalog_lookup_entry_v1beta1]
from google.cloud import datacatalog_v1beta1

"""
Lookup Entry
Expand Down
1 change: 1 addition & 0 deletions datacatalog/v1beta1/lookup_entry_sql_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
def sample_lookup_entry(sql_name: str):
# [START data_catalog_lookup_entry_sql_resource_v1beta1]
from google.cloud import datacatalog_v1beta1

"""
Lookup Entry using SQL resource
Expand Down
1 change: 1 addition & 0 deletions datacatalog/v1beta1/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def sample_search_catalog(
):
# [START data_catalog_search_v1beta1]
from google.cloud import datacatalog_v1beta1

"""
Search Catalog
Expand Down
4 changes: 3 additions & 1 deletion datacatalog/v1beta1/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@


def test_search_catalog(client, project_id, entry_group_name):
results = search.sample_search_catalog(project_id, False, f"name:{entry_group_name}")
results = search.sample_search_catalog(
project_id, False, f"name:{entry_group_name}"
)
assert results is not None

0 comments on commit 2ca0fb1

Please sign in to comment.