diff --git a/.dockerignore b/.dockerignore index f40cffa7..ddf60e0c 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,4 +2,4 @@ helm/ .venv/ .github/ -lib/ \ No newline at end of file +lib/ diff --git a/lib/permit-datafilter/MANIFEST.in b/lib/permit-datafilter/MANIFEST.in index 698cd966..479b8867 100644 --- a/lib/permit-datafilter/MANIFEST.in +++ b/lib/permit-datafilter/MANIFEST.in @@ -1 +1 @@ -include *.md requirements.txt \ No newline at end of file +include *.md requirements.txt diff --git a/lib/permit-datafilter/Makefile b/lib/permit-datafilter/Makefile index 3ff80647..b411d380 100644 --- a/lib/permit-datafilter/Makefile +++ b/lib/permit-datafilter/Makefile @@ -8,4 +8,4 @@ clean: publish: $(MAKE) clean python setup.py sdist bdist_wheel - python -m twine upload dist/* \ No newline at end of file + python -m twine upload dist/* diff --git a/lib/permit-datafilter/requirements.txt b/lib/permit-datafilter/requirements.txt index ac3bcaf2..27c9ec1f 100644 --- a/lib/permit-datafilter/requirements.txt +++ b/lib/permit-datafilter/requirements.txt @@ -4,4 +4,4 @@ fastapi>=0.109.1,<1 loguru pydantic[email]>=1.9.1,<2 pytest -SQLAlchemy==1.4.46 \ No newline at end of file +SQLAlchemy==1.4.46 diff --git a/lib/permit-datafilter/tests/test_data_filtering_usage.py b/lib/permit-datafilter/tests/test_data_filtering_usage.py index 969c047b..2de4c8eb 100644 --- a/lib/permit-datafilter/tests/test_data_filtering_usage.py +++ b/lib/permit-datafilter/tests/test_data_filtering_usage.py @@ -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'""" ) @@ -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'""" ) @@ -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 @@ -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