Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 1, 2024
1 parent 0cdd49a commit 126a32b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from helpers.common_test_tables import customers_test_table, customers_huge_test_table
from helpers.common_test_tables import customers_huge_test_table, customers_test_table
from helpers.data_source_fixture import DataSourceFixture
from helpers.mock_http_request import MockHttpRequest
from helpers.mock_http_sampler import MockHttpSampler
Expand Down
18 changes: 10 additions & 8 deletions soda/core/tests/helpers/common_test_tables.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import os
from faker import Faker
from random import randint, uniform, choice
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal
from datetime import date, datetime, timezone, timedelta
from random import choice, randint, uniform

from faker import Faker
from helpers.test_table import TestTable
from soda.execution.data_type import DataType

utc = timezone.utc


def generate_customer_records(num_records):
fake = Faker()
start_date = datetime.now()
Expand All @@ -24,18 +25,19 @@ def generate_customer_records(num_records):
fake.word(), # cst_size_txt
randint(1, 10000), # distance
f"{randint(0, 100)}%", # pct
choice(['A', 'B', 'C', 'D']), # cat
choice(['PL', 'BE', 'NL', 'US']), # country
choice(["A", "B", "C", "D"]), # cat
choice(["PL", "BE", "NL", "US"]), # country
fake.zipcode(), # zip
fake.email(), # email
fake.date_this_century(), # date_updated
current_date, # ts
current_date_with_tz # ts_with_tz
current_date_with_tz, # ts_with_tz
)
records.append(record)

return records


customers_test_table = TestTable(
name="Customers",
create_view=os.getenv("TEST_WITH_VIEWS", False),
Expand Down Expand Up @@ -88,7 +90,7 @@ def generate_customer_records(num_records):
("ts", DataType.TIMESTAMP),
("ts_with_tz", DataType.TIMESTAMP_TZ),
],
values=generate_customer_records(120)
values=generate_customer_records(120),
)

customers_dist_check_test_table = TestTable(
Expand Down
2 changes: 1 addition & 1 deletion soda/core/tests/helpers/mock_soda_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def find_check(self, check_index: int) -> dict | None:
checks = scan_result["checks"]
assert len(checks) > check_index
return checks[check_index]

def find_check_metric(self, metric_name: str) -> dict | None:
assert len(self.scan_results) > 0
scan_result = self.scan_results[0]
Expand Down

0 comments on commit 126a32b

Please sign in to comment.