Skip to content

Commit

Permalink
fix precommit errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Asaf Cohen committed Aug 12, 2024
1 parent c97fda1 commit 1b4bcc8
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
helm/
.venv/
.github/
lib/
lib/
2 changes: 1 addition & 1 deletion lib/permit-datafilter/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include *.md requirements.txt
include *.md requirements.txt
2 changes: 1 addition & 1 deletion lib/permit-datafilter/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ clean:
publish:
$(MAKE) clean
python setup.py sdist bdist_wheel
python -m twine upload dist/*
python -m twine upload dist/*
2 changes: 1 addition & 1 deletion lib/permit-datafilter/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ fastapi>=0.109.1,<1
loguru
pydantic[email]>=1.9.1,<2
pytest
SQLAlchemy==1.4.46
SQLAlchemy==1.4.46
16 changes: 8 additions & 8 deletions lib/permit-datafilter/tests/test_data_filtering_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,16 @@ class Task(Base):
str_query = query_to_string(sa_query)

assert striplines(str_query) == striplines(
"""SELECT task.id, task.created_at, task.updated_at, task.description, task.tenant_id
FROM task
"""SELECT task.id, task.created_at, task.updated_at, task.description, task.tenant_id
FROM task
WHERE task.tenant_id = '082f6978-6424-4e05-a706-1ab6f26c3768'"""
)

str_query_only_columns = query_to_string(sa_query.with_only_columns(Task.id))

assert striplines(str_query_only_columns) == striplines(
"""SELECT task.id
FROM task
"""SELECT task.id
FROM task
WHERE task.tenant_id = '082f6978-6424-4e05-a706-1ab6f26c3768'"""
)

Expand Down Expand Up @@ -141,8 +141,8 @@ class TaskJoined(Base):
str_query = query_to_string(sa_query)

assert striplines(str_query) == striplines(
"""SELECT task_joined.id, task_joined.created_at, task_joined.updated_at, task_joined.description, task_joined.tenant_id_joined
FROM task_joined JOIN tenant ON task_joined.tenant_id_joined = tenant.id
"""SELECT task_joined.id, task_joined.created_at, task_joined.updated_at, task_joined.description, task_joined.tenant_id_joined
FROM task_joined JOIN tenant ON task_joined.tenant_id_joined = tenant.id
WHERE tenant.key = '082f6978-6424-4e05-a706-1ab6f26c3768'"""
)

Expand Down Expand Up @@ -170,7 +170,7 @@ class Tasks(Base):

str_query = query_to_string(sa_query)
assert striplines(str_query) == striplines(
"""SELECT tasks.id, tasks.created_at, tasks.updated_at, tasks.description, tasks.tenant_id
"""SELECT tasks.id, tasks.created_at, tasks.updated_at, tasks.description, tasks.tenant_id
FROM tasks"""
) # this query would always return all rows from the tasks table

Expand All @@ -187,7 +187,7 @@ class Tasks(Base):

str_query = query_to_string(sa_query)
assert striplines(str_query) == striplines(
"""SELECT tasks.id, tasks.created_at, tasks.updated_at, tasks.description, tasks.tenant_id
"""SELECT tasks.id, tasks.created_at, tasks.updated_at, tasks.description, tasks.tenant_id
FROM tasks
WHERE false"""
) # this query would never have any results
Expand Down

0 comments on commit 1b4bcc8

Please sign in to comment.