From 8691982511b2f886def7e6c37579109ac1ee6619 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 29 May 2024 08:17:56 +0200 Subject: [PATCH] ruff format --- datacontract/catalog/catalog.py | 3 +- datacontract/cli.py | 6 ++-- datacontract/data_contract.py | 33 +++++++-------------- datacontract/export/html_export.py | 3 +- datacontract/export/jsonschema_converter.py | 3 +- datacontract/export/rdf_converter.py | 3 +- datacontract/imports/avro_importer.py | 3 +- datacontract/imports/bigquery_importer.py | 3 +- datacontract/imports/jsonschema_importer.py | 3 +- datacontract/imports/sql_importer.py | 3 +- datacontract/lint/resolve.py | 3 +- tests/test_export_avro.py | 3 +- tests/test_export_html.py | 3 +- tests/test_export_rdf.py | 3 +- 14 files changed, 25 insertions(+), 50 deletions(-) diff --git a/datacontract/catalog/catalog.py b/datacontract/catalog/catalog.py index aa55e29d..74c3503f 100644 --- a/datacontract/catalog/catalog.py +++ b/datacontract/catalog/catalog.py @@ -7,8 +7,7 @@ from datacontract.data_contract import DataContract from datacontract.export.html_export import get_version -from datacontract.model.data_contract_specification import \ - DataContractSpecification +from datacontract.model.data_contract_specification import DataContractSpecification def create_data_contract_html(contracts, file: Path, path: Path): diff --git a/datacontract/cli.py b/datacontract/cli.py index 053f6bc8..9f9db1f2 100644 --- a/datacontract/cli.py +++ b/datacontract/cli.py @@ -12,11 +12,9 @@ from typer.core import TyperGroup from typing_extensions import Annotated -from datacontract.catalog.catalog import create_index_html, \ - create_data_contract_html +from datacontract.catalog.catalog import create_index_html, create_data_contract_html from datacontract.data_contract import DataContract -from datacontract.init.download_datacontract_file import \ - download_datacontract_file, FileExistsException +from datacontract.init.download_datacontract_file import download_datacontract_file, FileExistsException from datacontract.publish.publish import publish_to_datamesh_manager console = Console() diff --git a/datacontract/data_contract.py b/datacontract/data_contract.py index d2415f1f..46997bf4 100644 --- a/datacontract/data_contract.py +++ b/datacontract/data_contract.py @@ -6,23 +6,19 @@ import yaml from pyspark.sql import SparkSession -from datacontract.breaking.breaking import models_breaking_changes, \ - quality_breaking_changes +from datacontract.breaking.breaking import models_breaking_changes, quality_breaking_changes from datacontract.engines.datacontract.check_that_datacontract_contains_valid_servers_configuration import ( check_that_datacontract_contains_valid_server_configuration, ) -from datacontract.engines.fastjsonschema.check_jsonschema import \ - check_jsonschema +from datacontract.engines.fastjsonschema.check_jsonschema import check_jsonschema from datacontract.engines.soda.check_soda_execute import check_soda_execute from datacontract.export.avro_converter import to_avro_schema_json from datacontract.export.avro_idl_converter import to_avro_idl from datacontract.export.bigquery_converter import to_bigquery_json from datacontract.export.dbml_converter import to_dbml_diagram -from datacontract.export.dbt_converter import to_dbt_models_yaml, \ - to_dbt_sources_yaml, to_dbt_staging_sql +from datacontract.export.dbt_converter import to_dbt_models_yaml, to_dbt_sources_yaml, to_dbt_staging_sql from datacontract.export.go_converter import to_go_types -from datacontract.export.great_expectations_converter import \ - to_great_expectations +from datacontract.export.great_expectations_converter import to_great_expectations from datacontract.export.html_export import to_html from datacontract.export.jsonschema_converter import to_jsonschema_json from datacontract.export.odcs_converter import to_odcs_yaml @@ -33,29 +29,22 @@ from datacontract.export.sql_converter import to_sql_ddl, to_sql_query from datacontract.export.terraform_converter import to_terraform from datacontract.imports.avro_importer import import_avro -from datacontract.imports.bigquery_importer import import_bigquery_from_api, \ - import_bigquery_from_json +from datacontract.imports.bigquery_importer import import_bigquery_from_api, import_bigquery_from_json from datacontract.imports.glue_importer import import_glue from datacontract.imports.jsonschema_importer import import_jsonschema from datacontract.imports.sql_importer import import_sql -from datacontract.integration.publish_datamesh_manager import \ - publish_datamesh_manager +from datacontract.integration.publish_datamesh_manager import publish_datamesh_manager from datacontract.integration.publish_opentelemetry import publish_opentelemetry from datacontract.lint import resolve from datacontract.lint.linters.description_linter import DescriptionLinter from datacontract.lint.linters.example_model_linter import ExampleModelLinter from datacontract.lint.linters.field_pattern_linter import FieldPatternLinter -from datacontract.lint.linters.field_reference_linter import \ - FieldReferenceLinter +from datacontract.lint.linters.field_reference_linter import FieldReferenceLinter from datacontract.lint.linters.notice_period_linter import NoticePeriodLinter -from datacontract.lint.linters.quality_schema_linter import \ - QualityUsesSchemaLinter -from datacontract.lint.linters.valid_constraints_linter import \ - ValidFieldConstraintsLinter -from datacontract.model.breaking_change import BreakingChanges, BreakingChange, \ - Severity -from datacontract.model.data_contract_specification import \ - DataContractSpecification, Server +from datacontract.lint.linters.quality_schema_linter import QualityUsesSchemaLinter +from datacontract.lint.linters.valid_constraints_linter import ValidFieldConstraintsLinter +from datacontract.model.breaking_change import BreakingChanges, BreakingChange, Severity +from datacontract.model.data_contract_specification import DataContractSpecification, Server from datacontract.model.exceptions import DataContractException from datacontract.model.run import Run, Check diff --git a/datacontract/export/html_export.py b/datacontract/export/html_export.py index 4cd8f1df..7bd0ff90 100644 --- a/datacontract/export/html_export.py +++ b/datacontract/export/html_export.py @@ -7,8 +7,7 @@ import yaml from jinja2 import Environment, PackageLoader, select_autoescape -from datacontract.model.data_contract_specification import \ - DataContractSpecification +from datacontract.model.data_contract_specification import DataContractSpecification def to_html(data_contract_spec: DataContractSpecification) -> str: diff --git a/datacontract/export/jsonschema_converter.py b/datacontract/export/jsonschema_converter.py index 6a48e3b9..d27812c0 100644 --- a/datacontract/export/jsonschema_converter.py +++ b/datacontract/export/jsonschema_converter.py @@ -1,8 +1,7 @@ import json from typing import Dict -from datacontract.model.data_contract_specification import \ - DataContractSpecification, Model, Field +from datacontract.model.data_contract_specification import DataContractSpecification, Model, Field def to_jsonschemas(data_contract_spec: DataContractSpecification): diff --git a/datacontract/export/rdf_converter.py b/datacontract/export/rdf_converter.py index 98af7c0d..dd2be036 100644 --- a/datacontract/export/rdf_converter.py +++ b/datacontract/export/rdf_converter.py @@ -1,8 +1,7 @@ from pydantic import BaseModel from rdflib import Graph, Literal, BNode, RDF, URIRef, Namespace -from datacontract.model.data_contract_specification import \ - DataContractSpecification +from datacontract.model.data_contract_specification import DataContractSpecification def is_literal(property_name): diff --git a/datacontract/imports/avro_importer.py b/datacontract/imports/avro_importer.py index 6265fde1..492a2926 100644 --- a/datacontract/imports/avro_importer.py +++ b/datacontract/imports/avro_importer.py @@ -1,7 +1,6 @@ import avro.schema -from datacontract.model.data_contract_specification import \ - DataContractSpecification, Model, Field +from datacontract.model.data_contract_specification import DataContractSpecification, Model, Field from datacontract.model.exceptions import DataContractException diff --git a/datacontract/imports/bigquery_importer.py b/datacontract/imports/bigquery_importer.py index 3ab0aad6..02dd8b6d 100644 --- a/datacontract/imports/bigquery_importer.py +++ b/datacontract/imports/bigquery_importer.py @@ -3,8 +3,7 @@ from google.cloud import bigquery -from datacontract.model.data_contract_specification import \ - DataContractSpecification, Model, Field +from datacontract.model.data_contract_specification import DataContractSpecification, Model, Field from datacontract.model.exceptions import DataContractException diff --git a/datacontract/imports/jsonschema_importer.py b/datacontract/imports/jsonschema_importer.py index 9ee8f279..6a00c060 100644 --- a/datacontract/imports/jsonschema_importer.py +++ b/datacontract/imports/jsonschema_importer.py @@ -2,8 +2,7 @@ import fastjsonschema -from datacontract.model.data_contract_specification import \ - DataContractSpecification, Model, Field, Definition +from datacontract.model.data_contract_specification import DataContractSpecification, Model, Field, Definition from datacontract.model.exceptions import DataContractException diff --git a/datacontract/imports/sql_importer.py b/datacontract/imports/sql_importer.py index 6248f145..71852dc7 100644 --- a/datacontract/imports/sql_importer.py +++ b/datacontract/imports/sql_importer.py @@ -1,7 +1,6 @@ from simple_ddl_parser import parse_from_file -from datacontract.model.data_contract_specification import \ - DataContractSpecification, Model, Field +from datacontract.model.data_contract_specification import DataContractSpecification, Model, Field def import_sql(data_contract_specification: DataContractSpecification, format: str, source: str): diff --git a/datacontract/lint/resolve.py b/datacontract/lint/resolve.py index 2616c1c1..47755a91 100644 --- a/datacontract/lint/resolve.py +++ b/datacontract/lint/resolve.py @@ -8,8 +8,7 @@ from datacontract.lint.files import read_file from datacontract.lint.schema import fetch_schema from datacontract.lint.urls import fetch_resource -from datacontract.model.data_contract_specification import \ - DataContractSpecification, Definition, Quality +from datacontract.model.data_contract_specification import DataContractSpecification, Definition, Quality from datacontract.model.exceptions import DataContractException diff --git a/tests/test_export_avro.py b/tests/test_export_avro.py index a8e744ed..de37b5ad 100644 --- a/tests/test_export_avro.py +++ b/tests/test_export_avro.py @@ -5,8 +5,7 @@ from datacontract.cli import app from datacontract.export.avro_converter import to_avro_schema_json -from datacontract.model.data_contract_specification import \ - DataContractSpecification +from datacontract.model.data_contract_specification import DataContractSpecification logging.basicConfig(level=logging.DEBUG, force=True) diff --git a/tests/test_export_html.py b/tests/test_export_html.py index d6514ae6..7f273cca 100644 --- a/tests/test_export_html.py +++ b/tests/test_export_html.py @@ -6,8 +6,7 @@ from datacontract.cli import app from datacontract.export.html_export import to_html -from datacontract.model.data_contract_specification import \ - DataContractSpecification +from datacontract.model.data_contract_specification import DataContractSpecification logging.basicConfig(level=logging.DEBUG, force=True) diff --git a/tests/test_export_rdf.py b/tests/test_export_rdf.py index 771ef706..6f64c3c9 100644 --- a/tests/test_export_rdf.py +++ b/tests/test_export_rdf.py @@ -8,8 +8,7 @@ from datacontract.cli import app from datacontract.export.rdf_converter import to_rdf -from datacontract.model.data_contract_specification import \ - DataContractSpecification +from datacontract.model.data_contract_specification import DataContractSpecification logging.basicConfig(level=logging.DEBUG, force=True)