Compare commits
28 Commits
python-0.2
...
python-0.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f68f997eb7 | ||
|
|
4d231c1db0 | ||
|
|
a1fdaacb4c | ||
|
|
09e24e13d3 | ||
|
|
1a2d8e865c | ||
|
|
a2790c90d9 | ||
|
|
083b634ea7 | ||
|
|
36f271751b | ||
|
|
2d78caeef2 | ||
|
|
24df64681d | ||
|
|
b7c9ff8dac | ||
|
|
f4df0a5f7c | ||
|
|
1daa5b1451 | ||
|
|
f075a9416b | ||
|
|
201ab42665 | ||
|
|
c793293fae | ||
|
|
40d1b4eafd | ||
|
|
0a902d7f00 | ||
|
|
9b95682243 | ||
|
|
e77038ce2f | ||
|
|
8f720e8165 | ||
|
|
da9948cba3 | ||
|
|
35ff75ea64 | ||
|
|
18459fb906 | ||
|
|
796ba4a15e | ||
|
|
63e5379016 | ||
|
|
ee837e0e5f | ||
|
|
c6e5711905 |
8
NEWS.md
8
NEWS.md
@@ -1,3 +1,11 @@
|
|||||||
|
Mar 17th, 2020
|
||||||
|
==============
|
||||||
|
* Version `0.29.0` of the client extension
|
||||||
|
* Adapted client to PG12 (https://github.com/CartoDB/cartodb-platform/issues/6237)
|
||||||
|
* Version `0.38.0` of the server extension
|
||||||
|
* Adapted server to PG12 (https://github.com/CartoDB/cartodb-platform/issues/6237)
|
||||||
|
* Update dependencies to fix vulnerabilities
|
||||||
|
|
||||||
Mar 6th, 2020
|
Mar 6th, 2020
|
||||||
==============
|
==============
|
||||||
* Version `0.23.1` of the Python library
|
* Version `0.23.1` of the Python library
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ SOURCES_DATA_DIR = sql/
|
|||||||
|
|
||||||
REGRESS = $(notdir $(basename $(sort $(wildcard test/sql/*test.sql))))
|
REGRESS = $(notdir $(basename $(sort $(wildcard test/sql/*test.sql))))
|
||||||
REGRESS_EXPEC = $(notdir $(basename $(sort $(wildcard test/expected/*test.out))))
|
REGRESS_EXPEC = $(notdir $(basename $(sort $(wildcard test/expected/*test.out))))
|
||||||
TEST_DIR = test_out
|
TEST_DIR = test
|
||||||
REGRESS_OPTS = --inputdir='$(TEST_DIR)' --outputdir='$(TEST_DIR)' --user='postgres'
|
REGRESS_OPTS = --inputdir='$(TEST_DIR)' --outputdir='$(TEST_DIR)' --user='postgres'
|
||||||
|
|
||||||
# DATA is a special variable used by postgres build infrastructure
|
# DATA is a special variable used by postgres build infrastructure
|
||||||
@@ -95,7 +95,8 @@ release: $(EXTENSION).control $(SOURCES_DATA)
|
|||||||
devclean:
|
devclean:
|
||||||
rm -f $(NEW_EXTENSION_ARTIFACT)
|
rm -f $(NEW_EXTENSION_ARTIFACT)
|
||||||
rm -f $(GENERATED_SQL_FILES)
|
rm -f $(GENERATED_SQL_FILES)
|
||||||
rm -rf $(TEST_DIR)
|
|
||||||
|
clean: restore_copies
|
||||||
|
|
||||||
# If needed remove PARALLEL tags from the release files
|
# If needed remove PARALLEL tags from the release files
|
||||||
release_remove_parallel_deploy:
|
release_remove_parallel_deploy:
|
||||||
@@ -107,21 +108,54 @@ ifeq ($(PG_PARALLEL), 0)
|
|||||||
done
|
done
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
restore_copies:
|
||||||
|
# tests
|
||||||
|
for f in $(basename $(wildcard test/sql/*.copy)); do \
|
||||||
|
cat $${f}.copy > $${f}; \
|
||||||
|
done
|
||||||
|
for f in $(basename $(wildcard test/expected/*.copy)); do \
|
||||||
|
cat $${f}.copy > $${f}; \
|
||||||
|
done
|
||||||
|
rm -f test/sql/*.copy;
|
||||||
|
rm -f test/expected/*.copy;
|
||||||
|
# data
|
||||||
|
for f in $(basename $(wildcard sql/*.copy)); do \
|
||||||
|
cat $${f}.copy > $${f}; \
|
||||||
|
done
|
||||||
|
rm -f sql/*.copy;
|
||||||
|
# old_versions
|
||||||
|
for f in $(basename $(wildcard old_versions/*.copy)); do \
|
||||||
|
cat $${f}.copy > $${f}; \
|
||||||
|
done
|
||||||
|
rm -f old_versions/*.copy;
|
||||||
|
# current scripts
|
||||||
|
for f in $(basename $(wildcard *.copy)); do \
|
||||||
|
cat $${f}.copy > $${f}; \
|
||||||
|
done
|
||||||
|
rm -f *.copy;
|
||||||
|
|
||||||
# Replacing variables defined within test files
|
# Replacing variables defined within test files
|
||||||
replace_variables:
|
replace_variables: restore_copies
|
||||||
mkdir -p $(TEST_DIR)
|
# tests
|
||||||
mkdir -p $(TEST_DIR)/expected
|
for f in $(sort $(wildcard test/sql/*test.sql)); do \
|
||||||
mkdir -p $(TEST_DIR)/sql
|
sed --in-place=.copy -e 's/@@plpythonu@@/$(PLPYTHONU)/g' $${f}; \
|
||||||
for f in $(REGRESS); do \
|
|
||||||
cat test/sql/$${f}.sql | \
|
|
||||||
sed -e 's/@@plpythonu@@/$(PLPYTHONU)/g' \
|
|
||||||
>> $(TEST_DIR)/sql/$${f}.sql; \
|
|
||||||
done
|
done
|
||||||
for f in $(REGRESS_EXPEC); do \
|
for f in $(sort $(wildcard test/expected/*test.out)); do \
|
||||||
cat test/expected/$${f}.out | \
|
sed --in-place=.copy -e 's/@@plpythonu@@/$(PLPYTHONU)/g' $${f}; \
|
||||||
sed -e 's/@@plpythonu@@/$(PLPYTHONU)/g' \
|
|
||||||
>> $(TEST_DIR)/expected/$${f}.out; \
|
|
||||||
done
|
done
|
||||||
|
# data
|
||||||
|
for f in $(wildcard sql/*.sql); do \
|
||||||
|
sed --in-place=.copy -e 's/@@plpythonu@@/$(PLPYTHONU)/g' $${f}; \
|
||||||
|
done
|
||||||
|
# old_versions
|
||||||
|
for f in $(wildcard old_versions/*.sql); do \
|
||||||
|
sed --in-place=.copy -e 's/@@plpythonu@@/$(PLPYTHONU)/g' $${f}; \
|
||||||
|
done
|
||||||
|
# current scripts
|
||||||
|
for f in $(wildcard *.sql); do \
|
||||||
|
sed --in-place=.copy -e 's/@@plpythonu@@/$(PLPYTHONU)/g' $${f}; \
|
||||||
|
done
|
||||||
|
sed --in-place=.copy -e 's/@@plpythonu@@/$(PLPYTHONU)/g' $(EXTENSION).control;
|
||||||
|
|
||||||
# Install the current release into the PostgreSQL extensions directory
|
# Install the current release into the PostgreSQL extensions directory
|
||||||
deploy: release_remove_parallel_deploy
|
deploy: release_remove_parallel_deploy
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"requires": {
|
"requires": {
|
||||||
"postgresql": "^11.0.0",
|
"postgresql": "^11.0.0",
|
||||||
"postgis": "^2.5.0.0",
|
"postgis": "^2.5.0.0",
|
||||||
"carto_postgresql_ext": "^0.32.0"
|
"carto_postgresql_ext": "^0.36.0"
|
||||||
},
|
},
|
||||||
"works_with": {
|
"works_with": {
|
||||||
}
|
}
|
||||||
|
|||||||
19
client/cdb_dataservices_client--0.28.0--0.29.0.sql
Normal file
19
client/cdb_dataservices_client--0.28.0--0.29.0.sql
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
--DO NOT MODIFY THIS FILE, IT IS GENERATED AUTOMATICALLY FROM SOURCES
|
||||||
|
-- Complain if script is sourced in psql, rather than via CREATE EXTENSION
|
||||||
|
\echo Use "ALTER EXTENSION cdb_dataservices_client UPDATE TO '0.29.0'" to load this file. \quit
|
||||||
|
|
||||||
|
-- Make sure we have a sane search path to create/update the extension
|
||||||
|
SET search_path = "$user",cartodb,public,cdb_dataservices_client;
|
||||||
|
|
||||||
|
-- HERE goes your code to upgrade/downgrade
|
||||||
|
-- PG12_DEPRECATED
|
||||||
|
-- Create geomval if it doesn't exist (in postgis 3+ it only exists in postgis_raster)
|
||||||
|
DO $$
|
||||||
|
BEGIN
|
||||||
|
IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'geomval') THEN
|
||||||
|
CREATE TYPE cdb_dataservices_client.geomval AS (
|
||||||
|
geom geometry,
|
||||||
|
val double precision
|
||||||
|
);
|
||||||
|
END IF;
|
||||||
|
END$$;
|
||||||
14
client/cdb_dataservices_client--0.29.0--0.28.0.sql
Normal file
14
client/cdb_dataservices_client--0.29.0--0.28.0.sql
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
--DO NOT MODIFY THIS FILE, IT IS GENERATED AUTOMATICALLY FROM SOURCES
|
||||||
|
-- Complain if script is sourced in psql, rather than via CREATE EXTENSION
|
||||||
|
\echo Use "ALTER EXTENSION cdb_dataservices_client UPDATE TO '0.28.0'" to load this file. \quit
|
||||||
|
|
||||||
|
-- Make sure we have a sane search path to create/update the extension
|
||||||
|
SET search_path = "$user",cartodb,public,cdb_dataservices_client;
|
||||||
|
|
||||||
|
-- HERE goes your code to upgrade/downgrade
|
||||||
|
-- PG12_DEPRECATED
|
||||||
|
-- Create geomval if it doesn't exist (in postgis 3+ it only exists in postgis_raster)
|
||||||
|
DO $$
|
||||||
|
BEGIN
|
||||||
|
DROP TYPE IF EXISTS cdb_dataservices_client.geomval RESTRICT;
|
||||||
|
END$$;
|
||||||
5836
client/cdb_dataservices_client--0.29.0.sql
Normal file
5836
client/cdb_dataservices_client--0.29.0.sql
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
|||||||
# Makefile to generate the extension out of separate sql source files.
|
# Makefile to generate the extension out of separate sql source files.
|
||||||
# Once a version is released, it is not meant to be changed. E.g: once version 0.0.1 is out, it SHALL NOT be changed.
|
# Once a version is released, it is not meant to be changed. E.g: once version 0.0.1 is out, it SHALL NOT be changed.
|
||||||
EXTENSION = cdb_dataservices_server
|
EXTENSION = cdb_dataservices_server
|
||||||
EXTVERSION = $(shell grep default_version $(EXTENSION).control.in | sed -e "s/default_version[[:space:]]*=[[:space:]]*'\([^']*\)'/\1/")
|
EXTVERSION = $(shell grep default_version $(EXTENSION).control | sed -e "s/default_version[[:space:]]*=[[:space:]]*'\([^']*\)'/\1/")
|
||||||
# The new version to be generated from templates
|
# The new version to be generated from templates
|
||||||
SED = sed
|
SED = sed
|
||||||
ERB = erb
|
ERB = erb
|
||||||
@@ -14,7 +14,7 @@ PG_PARALLEL := $(shell $(PG_CONFIG) --version | ($(AWK) '{$$2*=1000; if ($$
|
|||||||
|
|
||||||
REGRESS = $(notdir $(basename $(sort $(wildcard test/sql/*test.sql))))
|
REGRESS = $(notdir $(basename $(sort $(wildcard test/sql/*test.sql))))
|
||||||
REGRESS_EXPEC = $(notdir $(basename $(sort $(wildcard test/expected/*test.out))))
|
REGRESS_EXPEC = $(notdir $(basename $(sort $(wildcard test/expected/*test.out))))
|
||||||
TEST_DIR = test_out
|
TEST_DIR = test
|
||||||
REGRESS_OPTS = --inputdir='$(TEST_DIR)' --outputdir='$(TEST_DIR)' --user='postgres'
|
REGRESS_OPTS = --inputdir='$(TEST_DIR)' --outputdir='$(TEST_DIR)' --user='postgres'
|
||||||
|
|
||||||
# DATA is a special variable used by postgres build infrastructure
|
# DATA is a special variable used by postgres build infrastructure
|
||||||
@@ -27,7 +27,6 @@ DATA = $(NEW_EXTENSION_ARTIFACT) \
|
|||||||
$(OLD_VERSIONS)
|
$(OLD_VERSIONS)
|
||||||
SOURCES_DATA_DIR = sql/
|
SOURCES_DATA_DIR = sql/
|
||||||
SOURCES_DATA = $(wildcard sql/*.sql)
|
SOURCES_DATA = $(wildcard sql/*.sql)
|
||||||
SOURCES_DATA_DIR_OUT = sql_out/
|
|
||||||
|
|
||||||
# postgres build stuff
|
# postgres build stuff
|
||||||
PG_CONFIG = pg_config
|
PG_CONFIG = pg_config
|
||||||
@@ -49,7 +48,7 @@ endif
|
|||||||
|
|
||||||
$(NEW_EXTENSION_ARTIFACT): $(SOURCES_DATA)
|
$(NEW_EXTENSION_ARTIFACT): $(SOURCES_DATA)
|
||||||
rm -f $@
|
rm -f $@
|
||||||
cat $(SOURCES_DATA_DIR_OUT)/*.sql >> $@
|
cat $(SOURCES_DATA_DIR)/*.sql >> $@
|
||||||
ifeq ($(PG_PARALLEL), 0)
|
ifeq ($(PG_PARALLEL), 0)
|
||||||
# Remove PARALLEL in aggregates and functions
|
# Remove PARALLEL in aggregates and functions
|
||||||
$(eval TMPFILE := $(shell mktemp /tmp/$(basename $0).XXXXXXXX))
|
$(eval TMPFILE := $(shell mktemp /tmp/$(basename $0).XXXXXXXX))
|
||||||
@@ -58,34 +57,35 @@ ifeq ($(PG_PARALLEL), 0)
|
|||||||
mv $(TMPFILE) $@
|
mv $(TMPFILE) $@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(EXTENSION).control: $(EXTENSION).control.in Makefile
|
# $(EXTENSION).control: $(EXTENSION).control.in Makefile
|
||||||
$(SED) $(REPLACEMENTS) $< > $@
|
# $(SED) $(REPLACEMENTS) $< > $@
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: replace_variables $(DATA)
|
all: $(DATA)
|
||||||
|
|
||||||
.PHONY: release
|
.PHONY: release
|
||||||
release: replace_variables $(EXTENSION).control $(SOURCES_DATA)
|
release: $(EXTENSION).control $(SOURCES_DATA)
|
||||||
test -n "$(NEW_VERSION)" # $$NEW_VERSION VARIABLE MISSING. Eg. make release NEW_VERSION=0.x.0
|
test -n "$(NEW_VERSION)" # $$NEW_VERSION VARIABLE MISSING. Eg. make release NEW_VERSION=0.x.0
|
||||||
git mv *.sql old_versions
|
for f in $(wildcard *.sql); do \
|
||||||
$(SED) $(REPLACEMENTS) $(EXTENSION).control.in > $(EXTENSION).control
|
git mv $${f} old_versions/$${f}; \
|
||||||
|
done
|
||||||
|
$(SED) -i 's/$(EXTVERSION)/$(NEW_VERSION)/g' $(EXTENSION).control
|
||||||
git add $(EXTENSION).control
|
git add $(EXTENSION).control
|
||||||
cat $(SOURCES_DATA_DIR_OUT)/*.sql > $(EXTENSION)--$(NEW_VERSION).sql
|
cat $(SOURCES_DATA_DIR)/*.sql > $(EXTENSION)--$(NEW_VERSION).sql
|
||||||
$(ERB) version=$(NEW_VERSION) upgrade_downgrade_template.erb > $(EXTENSION)--$(EXTVERSION)--$(NEW_VERSION).sql
|
$(ERB) version=$(NEW_VERSION) upgrade_downgrade_template.erb > $(EXTENSION)--$(EXTVERSION)--$(NEW_VERSION).sql
|
||||||
$(ERB) version=$(EXTVERSION) upgrade_downgrade_template.erb > $(EXTENSION)--$(NEW_VERSION)--$(EXTVERSION).sql
|
$(ERB) version=$(EXTVERSION) upgrade_downgrade_template.erb > $(EXTENSION)--$(NEW_VERSION)--$(EXTVERSION).sql
|
||||||
git add $(EXTENSION)--$(NEW_VERSION).sql
|
git add $(EXTENSION)--$(NEW_VERSION).sql
|
||||||
@echo
|
@echo
|
||||||
@echo "Please review the file $(EXTENSION)--$(EXTVERSION)--$(NEW_VERSION).sql and add any code needed to upgrade $(EXTVERSION) to $(NEW_VERSION)"
|
@echo "Please review the file $(EXTENSION)--$(EXTVERSION)--$(NEW_VERSION).sql.in and add any code needed to upgrade $(EXTVERSION) to $(NEW_VERSION)"
|
||||||
@echo "Please review the file $(EXTENSION)--$(NEW_VERSION)--$(EXTVERSION).sql and add any code needed to downgrade $(NEW_VERSION) to $(EXTVERSION)"
|
@echo "Please review the file $(EXTENSION)--$(NEW_VERSION)--$(EXTVERSION).sql.in and add any code needed to downgrade $(NEW_VERSION) to $(EXTVERSION)"
|
||||||
@echo
|
@echo
|
||||||
|
|
||||||
# Only meant for development time, do not use once a version is released
|
# Only meant for development time, do not use once a version is released
|
||||||
.PHONY: devclean
|
.PHONY: devclean
|
||||||
devclean:
|
devclean:
|
||||||
rm -f $(NEW_EXTENSION_ARTIFACT)
|
rm -f $(NEW_EXTENSION_ARTIFACT)
|
||||||
rm -rf $(TEST_DIR)
|
|
||||||
rm -rf $(SOURCES_DATA_DIR_OUT)
|
clean: restore_copies
|
||||||
rm -rf $(EXTENSION).control
|
|
||||||
|
|
||||||
# If needed remove PARALLEL tags from the release files
|
# If needed remove PARALLEL tags from the release files
|
||||||
release_remove_parallel_deploy:
|
release_remove_parallel_deploy:
|
||||||
@@ -102,31 +102,60 @@ deploy: release_remove_parallel_deploy
|
|||||||
$(INSTALL_DATA) $(EXTENSION).control '$(DESTDIR)$(datadir)/extension/'
|
$(INSTALL_DATA) $(EXTENSION).control '$(DESTDIR)$(datadir)/extension/'
|
||||||
$(INSTALL_DATA) old_versions/*.sql *.sql '$(DESTDIR)$(datadir)/extension/'
|
$(INSTALL_DATA) old_versions/*.sql *.sql '$(DESTDIR)$(datadir)/extension/'
|
||||||
|
|
||||||
# Replacing variables defined within test files
|
restore_copies:
|
||||||
replace_variables:
|
|
||||||
# tests
|
# tests
|
||||||
mkdir -p $(TEST_DIR)
|
for f in $(basename $(wildcard test/sql/*.copy)); do \
|
||||||
mkdir -p $(TEST_DIR)/expected
|
cat $${f}.copy > $${f}; \
|
||||||
mkdir -p $(TEST_DIR)/sql
|
|
||||||
for f in $(REGRESS); do \
|
|
||||||
cat test/sql/$${f}.sql | \
|
|
||||||
sed -e 's/@@plpythonu@@/$(PLPYTHONU)/g' \
|
|
||||||
> $(TEST_DIR)/sql/$${f}.sql; \
|
|
||||||
done
|
done
|
||||||
for f in $(REGRESS_EXPEC); do \
|
for f in $(basename $(wildcard test/expected/*.copy)); do \
|
||||||
cat test/expected/$${f}.out | \
|
cat $${f}.copy > $${f}; \
|
||||||
sed -e 's/@@plpythonu@@/$(PLPYTHONU)/g' \
|
done
|
||||||
> $(TEST_DIR)/expected/$${f}.out; \
|
rm -f test/sql/*.copy;
|
||||||
|
rm -f test/expected/*.copy;
|
||||||
|
# data
|
||||||
|
for f in $(basename $(wildcard sql/*.copy)); do \
|
||||||
|
cat $${f}.copy > $${f}; \
|
||||||
|
done
|
||||||
|
rm -f sql/*.copy;
|
||||||
|
# old_versions
|
||||||
|
for f in $(basename $(wildcard old_versions/*.copy)); do \
|
||||||
|
cat $${f}.copy > $${f}; \
|
||||||
|
done
|
||||||
|
rm -f old_versions/*.copy;
|
||||||
|
# current scripts
|
||||||
|
for f in $(basename $(wildcard *.copy)); do \
|
||||||
|
cat $${f}.copy > $${f}; \
|
||||||
|
done
|
||||||
|
rm -f *.copy;
|
||||||
|
|
||||||
|
|
||||||
|
# %.sql:
|
||||||
|
# $(SED) $(REPLACEMENTS) $< > $@
|
||||||
|
|
||||||
|
# Replacing variables defined within test files
|
||||||
|
replace_variables: restore_copies
|
||||||
|
# tests
|
||||||
|
for f in $(sort $(wildcard test/sql/*test.sql)); do \
|
||||||
|
sed --in-place=.copy -e 's/@@plpythonu@@/$(PLPYTHONU)/g' $${f}; \
|
||||||
|
done
|
||||||
|
for f in $(sort $(wildcard test/expected/*test.out)); do \
|
||||||
|
sed --in-place=.copy -e 's/@@plpythonu@@/$(PLPYTHONU)/g' $${f}; \
|
||||||
done
|
done
|
||||||
# data
|
# data
|
||||||
mkdir -p $(SOURCES_DATA_DIR_OUT)
|
for f in $(SOURCES_DATA); do \
|
||||||
for f in $(notdir $(SOURCES_DATA)); do \
|
sed --in-place=.copy -e 's/@@plpythonu@@/$(PLPYTHONU)/g' $${f}; \
|
||||||
cat $(SOURCES_DATA_DIR)/$${f} | \
|
|
||||||
sed -e 's/@@plpythonu@@/$(PLPYTHONU)/g' \
|
|
||||||
> $(SOURCES_DATA_DIR_OUT)/$${f}; \
|
|
||||||
done
|
done
|
||||||
|
# old_versions
|
||||||
|
for f in $(wildcard old_versions/*.sql); do \
|
||||||
|
sed --in-place=.copy -e 's/@@plpythonu@@/$(PLPYTHONU)/g' $${f}; \
|
||||||
|
done
|
||||||
|
# current scripts
|
||||||
|
for f in $(wildcard *.sql); do \
|
||||||
|
sed --in-place=.copy -e 's/@@plpythonu@@/$(PLPYTHONU)/g' $${f}; \
|
||||||
|
done
|
||||||
|
sed --in-place=.copy -e 's/@@plpythonu@@/$(PLPYTHONU)/g' $(EXTENSION).control;
|
||||||
|
|
||||||
install: deploy
|
install: replace_variables deploy
|
||||||
|
|
||||||
reinstall: install
|
reinstall: install
|
||||||
psql -U postgres -d dataservices_db -c "drop extension if exists cdb_dataservices_server; create extension cdb_dataservices_server;"
|
psql -U postgres -d dataservices_db -c "drop extension if exists cdb_dataservices_server; create extension cdb_dataservices_server;"
|
||||||
|
|||||||
@@ -4,11 +4,11 @@
|
|||||||
"requires": {
|
"requires": {
|
||||||
"postgresql": "^10.0.0",
|
"postgresql": "^10.0.0",
|
||||||
"postgis": "^2.4.0.0",
|
"postgis": "^2.4.0.0",
|
||||||
"carto_postgresql_ext": "^0.23.0"
|
"carto_postgresql_ext": "^0.36.0"
|
||||||
},
|
},
|
||||||
"works_with": {
|
"works_with": {
|
||||||
"dataservices-api-server-python-lib": "^0.19.1",
|
"dataservices-api-server-python-lib": "^0.23.1",
|
||||||
"observatory-server-extension": "^1.9.0"
|
"observatory-server-extension": "^1.9.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
76
server/extension/cdb_dataservices_server--0.37.0--0.38.0.sql
Normal file
76
server/extension/cdb_dataservices_server--0.37.0--0.38.0.sql
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
--DO NOT MODIFY THIS FILE, IT IS GENERATED AUTOMATICALLY FROM SOURCES
|
||||||
|
-- Complain if script is sourced in psql, rather than via CREATE EXTENSION
|
||||||
|
\echo Use "ALTER EXTENSION cdb_dataservices_server UPDATE TO '0.38.0'" to load this file. \quit
|
||||||
|
|
||||||
|
-- HERE goes your code to upgrade/downgrade
|
||||||
|
-- PG12_DEPRECATED
|
||||||
|
-- Create geomval if it doesn't exist (in postgis 3+ it only exists in postgis_raster)
|
||||||
|
DO $$
|
||||||
|
BEGIN
|
||||||
|
IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'geomval') THEN
|
||||||
|
CREATE TYPE cdb_dataservices_server.geomval AS (
|
||||||
|
geom geometry,
|
||||||
|
val double precision
|
||||||
|
);
|
||||||
|
END IF;
|
||||||
|
END$$;
|
||||||
|
|
||||||
|
---- cdb_geocode_namedplace_point(city_name text)
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text)
|
||||||
|
RETURNS Geometry AS $$
|
||||||
|
from plpy import spiexceptions
|
||||||
|
from cartodb_services.tools import Logger,LoggerConfig
|
||||||
|
|
||||||
|
plpy.execute("SELECT cdb_dataservices_server._get_logger_config()")
|
||||||
|
logger_config = GD["logger_config"]
|
||||||
|
logger = Logger(logger_config)
|
||||||
|
|
||||||
|
try:
|
||||||
|
street_point = plpy.prepare("SELECT cdb_dataservices_server.cdb_geocode_street_point($1, $2, $3) as point;", ["text", "text", "text"])
|
||||||
|
return plpy.execute(street_point, [username, orgname, city_name])[0]['point']
|
||||||
|
except spiexceptions.ExternalRoutineException as e:
|
||||||
|
import sys
|
||||||
|
logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname})
|
||||||
|
internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3) as point;", ["text", "text", "text"])
|
||||||
|
return plpy.execute(internal_plan, [username, orgname, city_name])[0]['point']
|
||||||
|
$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED;
|
||||||
|
|
||||||
|
---- cdb_geocode_namedplace_point(city_name text, country_name text)
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, country_name text)
|
||||||
|
RETURNS Geometry AS $$
|
||||||
|
from plpy import spiexceptions
|
||||||
|
from cartodb_services.tools import Logger,LoggerConfig
|
||||||
|
|
||||||
|
plpy.execute("SELECT cdb_dataservices_server._get_logger_config()")
|
||||||
|
logger_config = GD["logger_config"]
|
||||||
|
logger = Logger(logger_config)
|
||||||
|
|
||||||
|
try:
|
||||||
|
street_point = plpy.prepare("SELECT cdb_dataservices_server.cdb_geocode_street_point($1, $2, $3, NULL, NULL, $4) as point;", ["text", "text", "text", "text"])
|
||||||
|
return plpy.execute(street_point, [username, orgname, city_name, country_name])[0]['point']
|
||||||
|
except spiexceptions.ExternalRoutineException as e:
|
||||||
|
import sys
|
||||||
|
logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname})
|
||||||
|
internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, NULL, $4) as point;", ["text", "text", "text", "text"])
|
||||||
|
return plpy.execute(internal_plan, [username, orgname, city_name, country_name])[0]['point']
|
||||||
|
$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED;
|
||||||
|
|
||||||
|
---- cdb_geocode_namedplace_point(city_name text, admin1_name text, country_name text)
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, admin1_name text, country_name text)
|
||||||
|
RETURNS Geometry AS $$
|
||||||
|
from plpy import spiexceptions
|
||||||
|
from cartodb_services.tools import Logger,LoggerConfig
|
||||||
|
|
||||||
|
plpy.execute("SELECT cdb_dataservices_server._get_logger_config()")
|
||||||
|
logger_config = GD["logger_config"]
|
||||||
|
logger = Logger(logger_config)
|
||||||
|
|
||||||
|
try:
|
||||||
|
street_point = plpy.prepare("SELECT cdb_dataservices_server.cdb_geocode_street_point($1, $2, $3, NULL, $4, $5) as point;", ["text", "text", "text", "text", "text"])
|
||||||
|
return plpy.execute(street_point, [username, orgname, city_name, admin1_name, country_name])[0]['point']
|
||||||
|
except spiexceptions.ExternalRoutineException as e:
|
||||||
|
import sys
|
||||||
|
logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname})
|
||||||
|
internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, $4, $5) as point;", ["text", "text", "text", "text", "text"])
|
||||||
|
return plpy.execute(internal_plan, [username, orgname, city_name, admin1_name, country_name])[0]['point']
|
||||||
|
$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED;
|
||||||
71
server/extension/cdb_dataservices_server--0.38.0--0.37.0.sql
Normal file
71
server/extension/cdb_dataservices_server--0.38.0--0.37.0.sql
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
--DO NOT MODIFY THIS FILE, IT IS GENERATED AUTOMATICALLY FROM SOURCES
|
||||||
|
-- Complain if script is sourced in psql, rather than via CREATE EXTENSION
|
||||||
|
\echo Use "ALTER EXTENSION cdb_dataservices_server UPDATE TO '0.37.0'" to load this file. \quit
|
||||||
|
|
||||||
|
-- HERE goes your code to upgrade/downgrade
|
||||||
|
-- PG12_DEPRECATED
|
||||||
|
-- Create geomval if it doesn't exist (in postgis 3+ it only exists in postgis_raster)
|
||||||
|
DO $$
|
||||||
|
BEGIN
|
||||||
|
DROP TYPE IF EXISTS cdb_dataservices_server.geomval RESTRICT;
|
||||||
|
END$$;
|
||||||
|
|
||||||
|
---- cdb_geocode_namedplace_point(city_name text)
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text)
|
||||||
|
RETURNS Geometry AS $$
|
||||||
|
import spiexceptions
|
||||||
|
from cartodb_services.tools import Logger,LoggerConfig
|
||||||
|
|
||||||
|
plpy.execute("SELECT cdb_dataservices_server._get_logger_config()")
|
||||||
|
logger_config = GD["logger_config"]
|
||||||
|
logger = Logger(logger_config)
|
||||||
|
|
||||||
|
try:
|
||||||
|
street_point = plpy.prepare("SELECT cdb_dataservices_server.cdb_geocode_street_point($1, $2, $3) as point;", ["text", "text", "text"])
|
||||||
|
return plpy.execute(street_point, [username, orgname, city_name])[0]['point']
|
||||||
|
except spiexceptions.ExternalRoutineException as e:
|
||||||
|
import sys
|
||||||
|
logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname})
|
||||||
|
internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3) as point;", ["text", "text", "text"])
|
||||||
|
return plpy.execute(internal_plan, [username, orgname, city_name])[0]['point']
|
||||||
|
$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED;
|
||||||
|
|
||||||
|
---- cdb_geocode_namedplace_point(city_name text, country_name text)
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, country_name text)
|
||||||
|
RETURNS Geometry AS $$
|
||||||
|
import spiexceptions
|
||||||
|
from cartodb_services.tools import Logger,LoggerConfig
|
||||||
|
|
||||||
|
plpy.execute("SELECT cdb_dataservices_server._get_logger_config()")
|
||||||
|
logger_config = GD["logger_config"]
|
||||||
|
logger = Logger(logger_config)
|
||||||
|
|
||||||
|
try:
|
||||||
|
street_point = plpy.prepare("SELECT cdb_dataservices_server.cdb_geocode_street_point($1, $2, $3, NULL, NULL, $4) as point;", ["text", "text", "text", "text"])
|
||||||
|
return plpy.execute(street_point, [username, orgname, city_name, country_name])[0]['point']
|
||||||
|
except spiexceptions.ExternalRoutineException as e:
|
||||||
|
import sys
|
||||||
|
logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname})
|
||||||
|
internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, NULL, $4) as point;", ["text", "text", "text", "text"])
|
||||||
|
return plpy.execute(internal_plan, [username, orgname, city_name, country_name])[0]['point']
|
||||||
|
$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED;
|
||||||
|
|
||||||
|
---- cdb_geocode_namedplace_point(city_name text, admin1_name text, country_name text)
|
||||||
|
CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_geocode_namedplace_point(username text, orgname text, city_name text, admin1_name text, country_name text)
|
||||||
|
RETURNS Geometry AS $$
|
||||||
|
import spiexceptions
|
||||||
|
from cartodb_services.tools import Logger,LoggerConfig
|
||||||
|
|
||||||
|
plpy.execute("SELECT cdb_dataservices_server._get_logger_config()")
|
||||||
|
logger_config = GD["logger_config"]
|
||||||
|
logger = Logger(logger_config)
|
||||||
|
|
||||||
|
try:
|
||||||
|
street_point = plpy.prepare("SELECT cdb_dataservices_server.cdb_geocode_street_point($1, $2, $3, NULL, $4, $5) as point;", ["text", "text", "text", "text", "text"])
|
||||||
|
return plpy.execute(street_point, [username, orgname, city_name, admin1_name, country_name])[0]['point']
|
||||||
|
except spiexceptions.ExternalRoutineException as e:
|
||||||
|
import sys
|
||||||
|
logger.error('Error geocoding namedplace using geocode street point, falling back to internal geocoder', sys.exc_info(), data={"username": username, "orgname": orgname})
|
||||||
|
internal_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_internal_geocode_namedplace($1, $2, $3, $4, $5) as point;", ["text", "text", "text", "text", "text"])
|
||||||
|
return plpy.execute(internal_plan, [username, orgname, city_name, admin1_name, country_name])[0]['point']
|
||||||
|
$$ LANGUAGE @@plpythonu@@ STABLE PARALLEL RESTRICTED;
|
||||||
3896
server/extension/cdb_dataservices_server--0.38.0.sql
Normal file
3896
server/extension/cdb_dataservices_server--0.38.0.sql
Normal file
File diff suppressed because it is too large
Load Diff
@@ -115,7 +115,7 @@ class HereMapsRoutingIsoline(Traceable):
|
|||||||
|
|
||||||
def __parse_source_param(self, source, options):
|
def __parse_source_param(self, source, options):
|
||||||
key = 'start'
|
key = 'start'
|
||||||
if 'is_destination' in options and options['is_destination']:
|
if 'is_destination' in options and options['is_destination'].lower() == 'true':
|
||||||
key = 'destination'
|
key = 'destination'
|
||||||
|
|
||||||
return {key: source}
|
return {key: source}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ python-dateutil==2.2
|
|||||||
googlemaps==2.5.1
|
googlemaps==2.5.1
|
||||||
rollbar==0.13.2
|
rollbar==0.13.2
|
||||||
# Dependency for googlemaps package
|
# Dependency for googlemaps package
|
||||||
requests==2.9.1
|
requests==2.20.0
|
||||||
rratelimit==0.0.4
|
rratelimit==0.0.4
|
||||||
mapbox==0.14.0
|
mapbox==0.14.0
|
||||||
pygeocodio==0.11.1
|
pygeocodio==0.11.1
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ from setuptools import setup, find_packages
|
|||||||
setup(
|
setup(
|
||||||
name='cartodb_services',
|
name='cartodb_services',
|
||||||
|
|
||||||
version='0.23.1',
|
version='0.23.2',
|
||||||
|
|
||||||
description='CartoDB Services API Python Library',
|
description='CartoDB Services API Python Library',
|
||||||
|
|
||||||
|
|||||||
@@ -204,6 +204,16 @@ class HereMapsRoutingIsolineTestCase(unittest.TestCase):
|
|||||||
'fastest;car;traffic:false;motorway:-1')
|
'fastest;car;traffic:false;motorway:-1')
|
||||||
|
|
||||||
def test_source_parameters_works_properly(self, req_mock):
|
def test_source_parameters_works_properly(self, req_mock):
|
||||||
|
req_mock.register_uri('GET', requests_mock.ANY,
|
||||||
|
text=self.GOOD_RESPONSE)
|
||||||
|
response = self.routing.calculate_isochrone('geo!33.0,1.0', 'car',
|
||||||
|
['1000', '2000'],
|
||||||
|
['is_destination=false'])
|
||||||
|
parsed_url = urlparse(req_mock.request_history[0].url)
|
||||||
|
url_params = parse_qs(parsed_url.query)
|
||||||
|
self.assertEqual(url_params['start'][0], 'geo!33.0,1.0')
|
||||||
|
|
||||||
|
def test_destination_parameters_works_properly(self, req_mock):
|
||||||
req_mock.register_uri('GET', requests_mock.ANY,
|
req_mock.register_uri('GET', requests_mock.ANY,
|
||||||
text=self.GOOD_RESPONSE)
|
text=self.GOOD_RESPONSE)
|
||||||
response = self.routing.calculate_isochrone('geo!33.0,1.0', 'car',
|
response = self.routing.calculate_isochrone('geo!33.0,1.0', 'car',
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
# Integration tests dependencies
|
# Integration tests dependencies
|
||||||
requests==2.9.1
|
requests==2.20.0
|
||||||
nose==1.3.7
|
nose==1.3.7
|
||||||
|
|||||||
Reference in New Issue
Block a user