Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit 620ca74

Browse files
committed
Reformat with black
1 parent 3ee4945 commit 620ca74

File tree

14 files changed

+28
-15
lines changed

14 files changed

+28
-15
lines changed

data_diff/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
@click.option("--max-age", default=None, help="Considers only rows younger than specified. See --min-age.")
5151
@click.option("-s", "--stats", is_flag=True, help="Print stats instead of a detailed diff")
5252
@click.option("-d", "--debug", is_flag=True, help="Print debug info")
53-
@click.option("--json", 'json_output', is_flag=True, help="Print JSONL output for machine readability")
53+
@click.option("--json", "json_output", is_flag=True, help="Print JSONL output for machine readability")
5454
@click.option("-v", "--verbose", is_flag=True, help="Print extra info")
5555
@click.option("-i", "--interactive", is_flag=True, help="Confirm queries, implies --debug")
5656
@click.option("--keep-column-case", is_flag=True, help="Don't use the schema to fix the case of given column names.")

data_diff/databases/base.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ def _inner():
3434
return dec
3535

3636

37-
38-
39-
4037
class ConnectError(Exception):
4138
pass
4239

@@ -57,7 +54,6 @@ def _query_conn(conn, sql_code: str) -> list:
5754
return c.fetchall()
5855

5956

60-
6157
class Database(AbstractDatabase):
6258
"""Base abstract class for databases.
6359
@@ -139,7 +135,9 @@ def _parse_type(
139135

140136
elif issubclass(cls, Decimal):
141137
if numeric_scale is None:
142-
raise ValueError(f"{self.name}: Unexpected numeric_scale is NULL, for column {col_name} of type {type_repr}.")
138+
raise ValueError(
139+
f"{self.name}: Unexpected numeric_scale is NULL, for column {col_name} of type {type_repr}."
140+
)
143141
return cls(precision=numeric_scale)
144142

145143
assert issubclass(cls, Float)
@@ -235,4 +233,3 @@ def close(self):
235233
DEFAULT_NUMERIC_PRECISION = 24
236234

237235
TIMESTAMP_PRECISION_POS = 20 # len("2022-06-03 12:24:35.") == 20
238-

data_diff/databases/bigquery.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from .base import Database, import_helper, parse_table_name, ConnectError
33
from .base import TIMESTAMP_PRECISION_POS
44

5+
56
@import_helper(text="Please install BigQuery and configure your google-cloud access.")
67
def import_bigquery():
78
from google.cloud import bigquery

data_diff/databases/connect.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from .redshift import Redshift
1414
from .presto import Presto
1515

16+
1617
@dataclass
1718
class MatchUriPath:
1819
database_cls: Type[Database]

data_diff/databases/database_types.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ def normalize_value_by_type(self, value: str, coltype: ColType) -> str:
152152
return self.normalize_number(value, coltype)
153153
return self.to_string(f"{value}")
154154

155-
156155
def _normalize_table_path(self, path: DbPath) -> DbPath:
157156
...
158157

data_diff/databases/mssql.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,3 @@ def md5_to_int(self, s: str) -> str:
2323

2424
def to_string(self, s: str):
2525
return f"CONVERT(varchar, {s})"
26-

data_diff/databases/mysql.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from .base import ThreadedDatabase, import_helper, ConnectError
33
from .base import MD5_HEXDIGITS, CHECKSUM_HEXDIGITS, TIMESTAMP_PRECISION_POS
44

5+
56
@import_helper("mysql")
67
def import_mysql():
78
import mysql.connector

data_diff/databases/oracle.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from .base import ThreadedDatabase, import_helper, ConnectError, QueryError
55
from .base import DEFAULT_DATETIME_PRECISION, DEFAULT_NUMERIC_PRECISION
66

7+
78
@import_helper("oracle")
89
def import_oracle():
910
import cx_Oracle

data_diff/databases/postgresql.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from .base import ThreadedDatabase, import_helper, ConnectError
33
from .base import MD5_HEXDIGITS, CHECKSUM_HEXDIGITS, _CHECKSUM_BITSIZE, TIMESTAMP_PRECISION_POS
44

5+
56
@import_helper("postgresql")
67
def import_postgresql():
78
import psycopg2
@@ -11,7 +12,6 @@ def import_postgresql():
1112
return psycopg2
1213

1314

14-
1515
class PostgreSQL(ThreadedDatabase):
1616
DATETIME_TYPES = {
1717
"timestamp with time zone": TimestampTZ,

data_diff/databases/presto.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22

33
from .database_types import *
44
from .base import Database, import_helper, _query_conn
5-
from .base import MD5_HEXDIGITS, CHECKSUM_HEXDIGITS, TIMESTAMP_PRECISION_POS, DEFAULT_DATETIME_PRECISION, DEFAULT_NUMERIC_PRECISION
5+
from .base import (
6+
MD5_HEXDIGITS,
7+
CHECKSUM_HEXDIGITS,
8+
TIMESTAMP_PRECISION_POS,
9+
DEFAULT_DATETIME_PRECISION,
10+
DEFAULT_NUMERIC_PRECISION,
11+
)
12+
613

714
@import_helper("presto")
815
def import_presto():

0 commit comments

Comments
 (0)