Skip to content

changing create role to create or alter role, changing grant role from individual user to sysadmin, adding uv into the project #9

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11
5 changes: 2 additions & 3 deletions create_snowflake_objects.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@

USE ROLE SECURITYADMIN;

CREATE ROLE cortex_user_role;
CREATE OR ALTER ROLE cortex_user_role;
GRANT DATABASE ROLE SNOWFLAKE.CORTEX_USER TO ROLE cortex_user_role;

-- TODO: Replace <your_user> with your username
GRANT ROLE cortex_user_role TO USER <your_user>;
GRANT ROLE cortex_user_role TO ROLE sysadmin;

USE ROLE sysadmin;

Expand Down
13 changes: 13 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[project]
name = "sfguide-getting-started-with-cortex-analyst"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.11"
dependencies = [
"pandas==2.2.3",
"requests==2.32.3",
"snowflake-connector-python==3.14.0",
"sseclient-py==1.8.0",
"streamlit==1.43.2",
]
30 changes: 15 additions & 15 deletions revenue_timeseries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,21 +145,21 @@ verified_queries:
verified_at: 1714752498
verified_by: renee
sql: "
SELECT
date,
SUM(daily_cogs) OVER (
ORDER BY
date ROWS BETWEEN UNBOUNDED PRECEDING
AND CURRENT ROW
) AS cumulative_cogs
FROM
daily_revenue
WHERE
date BETWEEN '2023-12-01'
AND '2023-12-31'
ORDER BY
date DESC;
"
SELECT
date,
SUM(daily_cogs) OVER (
ORDER BY
date ROWS BETWEEN UNBOUNDED PRECEDING
AND CURRENT ROW
) AS cumulative_cogs
FROM
daily_revenue
WHERE
date BETWEEN '2023-12-01'
AND '2023-12-31'
ORDER BY
date DESC;
"
# For eval sample nlimtiaco_sc_6__0
- name: "lowest revenue each month"
question: "For each month, what was the lowest daily revenue and on what date did that lowest revenue occur?"
Expand Down
Loading