Skip to content

Commit

Permalink
ruff format
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenchrist committed May 29, 2024
1 parent d1e23d7 commit 8691982
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 50 deletions.
3 changes: 1 addition & 2 deletions datacontract/catalog/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
6 changes: 2 additions & 4 deletions datacontract/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
33 changes: 11 additions & 22 deletions datacontract/data_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
3 changes: 1 addition & 2 deletions datacontract/export/html_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 1 addition & 2 deletions datacontract/export/jsonschema_converter.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
3 changes: 1 addition & 2 deletions datacontract/export/rdf_converter.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
3 changes: 1 addition & 2 deletions datacontract/imports/avro_importer.py
Original file line number Diff line number Diff line change
@@ -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


Expand Down
3 changes: 1 addition & 2 deletions datacontract/imports/bigquery_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
3 changes: 1 addition & 2 deletions datacontract/imports/jsonschema_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
3 changes: 1 addition & 2 deletions datacontract/imports/sql_importer.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
3 changes: 1 addition & 2 deletions datacontract/lint/resolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
3 changes: 1 addition & 2 deletions tests/test_export_avro.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
3 changes: 1 addition & 2 deletions tests/test_export_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
3 changes: 1 addition & 2 deletions tests/test_export_rdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 8691982

Please sign in to comment.