-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix exclude/include tables #131
Conversation
tipg/sql/dbcatalog.sql
Outdated
@@ -246,10 +246,11 @@ CREATE OR REPLACE FUNCTION pg_temp.tipg_catalog( | |||
AND relkind IN ('r','v', 'm', 'f', 'p') | |||
AND has_table_privilege(c.oid, 'SELECT') | |||
AND c.relname::text NOT IN ('spatial_ref_sys','geometry_columns','geography_columns') | |||
AND (exclude_tables IS NULL OR concat(c.relnamespace::regnamespace::text,'.',c.relname::text) != ANY (exclude_tables)) | |||
AND (exclude_tables IS NULL OR concat(c.relnamespace::regnamespace::text,'.',c.relname::text) <> ALL (exclude_tables)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to fix #130
tipg/sql/dbcatalog.sql
Outdated
AND (functions IS NULL OR concat(p.pronamespace::regnamespace::text, '.', proname::text) = ANY (functions)) | ||
AND (exclude_functions IS NULL OR concat(p.pronamespace::regnamespace::text,'.',proname::text) != ANY (exclude_functions)) | ||
AND (exclude_functions IS NULL OR concat(p.pronamespace::regnamespace::text,'.',proname::text) <> ALL (exclude_functions)) | ||
AND (functions IS NULL OR concat(p.pronamespace::regnamespace::text,'.',proname::text) = ANY (functions)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand but the include/exclude filter do not work for function (see the failing tests)
cc @bitner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, this is because the actual namespace of the function isn't pg_temp -- pg_temp is an automatic alias for a temp schema that is created behind the scenes
@@ -140,7 +141,7 @@ def test_collections_includes(app_includes): | |||
assert response.status_code == 200 | |||
body = response.json() | |||
ids = [x["id"] for x in body["collections"]] | |||
assert ["public.nongeo_data"] == ids | |||
assert ["public.minnesota", "public.nongeo_data"] == ids |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests for #130
tests/routes/test_collections.py
Outdated
assert response.status_code == 200 | ||
body = response.json() | ||
ids = [x["id"] for x in body["collections"]] | ||
assert ["pg_temp.hexagons", "pg_temp.squares"] == ids |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those 2 tests are failing right now 🤷
Just checking on the progress for this bug? |
closes #130