Skip to content

Commit

Permalink
release: 2024-09-23 (#529)
Browse files Browse the repository at this point in the history
  • Loading branch information
vdelacruzb authored Sep 24, 2024
1 parent 6234848 commit 109a961
Show file tree
Hide file tree
Showing 13 changed files with 46 additions and 10 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ CARTO Analytics Toolbox Core.

All notable commits to this project will be documented in this file.

## 2024-09-23

- feat(sf): added warehouse option for SF (#524)
- chore(bq): increse jest timeout to 30000 (#525)
- docs(sf): add docs on how to update the analytics toolbox from a native app (#527)
- chore(sf): update python version on stored procedures from 3.8 to 3.9 (#528)

## 2024-08-22

- chore(rs): bump scipy from 0.12.0 to 0.12.1 in /clouds/redshift/libraries/python (#518)
Expand Down
2 changes: 1 addition & 1 deletion clouds/bigquery/modules/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ test: check $(NODE_MODULES_DEV)
if [ ! -z "$$TESTS" ]; then \
GOOGLE_APPLICATION_CREDENTIALS=$(GOOGLE_APPLICATION_CREDENTIALS) \
PATH="$(NODE_MODULES_DEV)/.bin/:$(PATH)" \
jest --testTimeout=250000 $(BAIL) --verbose --slowTestThreshold=20 --maxConcurrency=10 $$TESTS \
jest --testTimeout=300000 $(BAIL) --verbose --slowTestThreshold=20 --maxConcurrency=10 $$TESTS \
--setupFilesAfterEnv "$(COMMON_DIR)/test-extend.js" || exit 1; \
OLD_TEST=$(TEST_DIR)/$$m/old-test; \
if [ -d $$OLD_TEST ]; then \
Expand Down
4 changes: 2 additions & 2 deletions clouds/bigquery/modules/sql/quadbin/QUADBIN_POLYFILL.sql
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ RETURNS INT64
AS ((
WITH __geog_area AS (
SELECT
508164597540055.75 AS q0_area,
ST_AREA(geog) AS geog_area,
COS(ST_Y(ST_CENTROID(geog)) * ACOS(-1) / 180) AS cos_geog_lat,
508164597540055.75 AS q0_area
COS(ST_Y(ST_CENTROID(geog)) * ACOS(-1) / 180) AS cos_geog_lat
)
-- compute the resolution of cells that match the geog area
SELECT IF(geog_area > 0 AND cos_geog_lat > 0,
Expand Down
1 change: 1 addition & 0 deletions clouds/snowflake/.env.template
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ SF_USER=<user>
SF_PASSWORD=<password>
SF_ROLE=<role> # optional
SF_SHARE=<share> # optional
SF_WAREHOUSE=<warehouse> # optional
8 changes: 7 additions & 1 deletion clouds/snowflake/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@ CARTO Analytics Toolbox Core for Snowflake.

All notable commits to this project will be documented in this file.

## [1.2.5] - 2024-09-23

- feat: added warehouse option for SF (#524)
- docs: add docs on how to update the analytics toolbox from a native app (#527)
- chore: update python version on stored procedures from 3.8 to 3.9 (#528)

## [1.2.4] - 2024-06-27

- chore(sf): refactor at snowflake native app to an installer (#512)
- chore: refactor at snowflake native app to an installer (#512)

## [1.2.3] - 2024-05-21

Expand Down
1 change: 1 addition & 0 deletions clouds/snowflake/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ SF_USER=<user>
SF_PASSWORD=<password>
SF_ROLE=<role> # optional
SF_SHARE=<share> # optional
SF_WAREHOUSE=<warehouse> # optional
```

## Structure
Expand Down
3 changes: 2 additions & 1 deletion clouds/snowflake/common/run-query.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const connection = snowflake.createConnection({
account: process.env.SF_ACCOUNT,
username: process.env.SF_USER,
password: process.env.SF_PASSWORD,
role: process.env.SF_ROLE
role: process.env.SF_ROLE,
warehouse: process.env.SF_WAREHOUSE
});

connection.connect((err) => {
Expand Down
3 changes: 2 additions & 1 deletion clouds/snowflake/common/run-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const connection = snowflake.createConnection({
account: process.env.SF_ACCOUNT,
username: process.env.SF_USER,
password: process.env.SF_PASSWORD,
role: process.env.SF_ROLE
role: process.env.SF_ROLE,
warehouse: process.env.SF_WAREHOUSE
});

connection.connect((err) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,3 @@ AS $$
SELECT @@SF_SCHEMA@@._QUADBIN_STRING_TOINT(@@SF_SCHEMA@@._QUADBIN_FROMZXY(z, x, y))
FROM __zxy
$$;

2 changes: 1 addition & 1 deletion clouds/snowflake/modules/sql/quadbin/QUADBIN_TOPARENT.sql
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ AS $$
resolution * 2
)
)
$$;
$$;
20 changes: 20 additions & 0 deletions clouds/snowflake/native_app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,26 @@ GRANT USAGE ON FUTURE PROCEDURES IN SCHEMA CARTO.CARTO TO ROLE PUBLIC;
CALL CARTO.CARTO.INSTALL('CARTO_ANALYTICS_TOOLBOX', 'CARTO.CARTO');
```

##### * Update the Analytics Toolbox

When a new package of the Analytics Toolbox gets released, the Analytics Toolbox installer gets updated automatically. As in the first installation most of the required permissions were already set, only the next queries should be necessary in order to update the Analytics Toolbox.

```
-- Set admin permissions
USE ROLE ACCOUNTADMIN;
-- Generate the installer procedure in the specified location
CALL CARTO_ANALYTICS_TOOLBOX.CARTO.GENERATE_INSTALLER('CARTO.CARTO');
-- Update ownership of the install procedure
GRANT OWNERSHIP ON PROCEDURE CARTO.CARTO.INSTALL(STRING, STRING) TO ROLE ACCOUNTADMIN REVOKE CURRENT GRANTS;
-- Install the Analytics Toolbox in CARTO.CARTO
CALL CARTO.CARTO.INSTALL('CARTO_ANALYTICS_TOOLBOX', 'CARTO.CARTO');
```

If your Analytics Toolbox doesn't get updated properly please try to drop the app, get it back from Snowflake Marketplace and follow the Step 1.

### Usage Examples

Please refer to CARTO's [SQL reference](https://docs.carto.com/data-and-analysis/analytics-toolbox-for-snowflake/sql-reference) to find the full list of available functions and procedures as well as examples.
Expand Down
2 changes: 1 addition & 1 deletion clouds/snowflake/native_app/SETUP_SCRIPT.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CREATE OR REPLACE PROCEDURE @@SF_APP_SCHEMA@@.GET_MODULES_SQL_FROM_STAGE()
returns string
language python
runtime_version = '3.8'
RUNTIME_VERSION = '3.9'
packages = ('snowflake-snowpark-python')
imports = (
'/get_modules_sql_from_stage.py',
Expand Down
2 changes: 1 addition & 1 deletion clouds/snowflake/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.4
1.2.5

0 comments on commit 109a961

Please sign in to comment.