Skip to content

Commit

Permalink
ref: Fix type checking errors and ensure scripts gets checked in CI (
Browse files Browse the repository at this point in the history
  • Loading branch information
lynnagara committed Jun 20, 2023
1 parent 305ea76 commit 2d2fb92
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ api-tests:
SNUBA_SETTINGS=test pytest -vv tests/*_api.py

backend-typing:
mypy snuba tests --strict --config-file mypy.ini --exclude 'tests/datasets|tests/query|tests/state|tests/snapshots|tests/clickhouse|tests/test_split.py|tests/test_copy_tables.py'
mypy snuba tests scripts --strict --config-file mypy.ini --exclude 'tests/datasets|tests/query|tests/state|tests/snapshots|tests/clickhouse|tests/test_split.py'

install-python-dependencies:
pip uninstall -qqy uwsgi # pip doesn't do well with swapping drop-ins
Expand Down
Empty file added scripts/__init__.py
Empty file.
4 changes: 4 additions & 0 deletions scripts/copy_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def _get_client(

def get_regex_match(curr_create_table_statement: str) -> str:
match = re.search("\/clickhouse([a-z\/\-{}_]*)", curr_create_table_statement)
assert match is not None
return match.group(0)


Expand Down Expand Up @@ -79,6 +80,9 @@ def verify_local_tables_exist_from_mv(
to_search = re.search("TO(.[.\w]*)", curr_create_table_statement)
from_search = re.search("FROM(.[.\w]*)", curr_create_table_statement)

assert to_search is not None
assert from_search is not None

# make sure we ditch the "default." before checking against SHOW TABLES
_, to_local_table = to_search.group(1).strip().split(".")
_, from_local_table = from_search.group(1).strip().split(".")
Expand Down

0 comments on commit 2d2fb92

Please sign in to comment.