Skip to content
Open

a #51

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
2 changes: 1 addition & 1 deletion .devcontainer/connections.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Can override the default connection name with an environment variable as follows
#export SNOWFLAKE_DEFAULT_CONNECTION_NAME="default"

[default]
[connections.default]
account = "myaccount"
user = "myuser"
password = "mypassword"
Expand Down
17 changes: 17 additions & 0 deletions .devcontainer/create_session.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from snowflake.snowpark import Session

connection_parameters = {
"account": "urxxlpr-dp02760",
"user": "zeal041",
"password": "Snowflake20021025",
"role": "HOL_ROLE",
"warehouse": "HOL_WH",
"database": "HOL_DB",
"schema": "ANALYTICS"
}

session = Session.builder.configs(connection_parameters).create()
print("✅ セッション作成成功")

df = session.sql("SELECT CURRENT_USER(), CURRENT_ROLE(), CURRENT_DATABASE(), CURRENT_SCHEMA()").collect()
print(df)
27 changes: 24 additions & 3 deletions steps/02_load_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,28 @@ def validate_raw_tables(session):

# For local debugging
if __name__ == "__main__":
# Create a local Snowpark session
with Session.builder.getOrCreate() as session:
load_all_raw_tables(session)
from snowflake.snowpark import Session

connection_parameters = {
"account": "urxxlpr-dp02760",
"user": "zeal041",
"password": "Snowflake20021025",
"role": "HOL_ROLE",
"warehouse": "HOL_WH",
"database": "HOL_DB",
"schema": "ANALYTICS"
}

#session = Session.builder.configs(connection_parameters).create()


# 以降、session を使って処理
#df = session.table("RAW_WEATHER_DATA")
#df.show()

# 最後にセッションを閉じる(任意)
#session.close()

# with Session.builder.getOrCreate() as session:
# load_all_raw_tables(session)
# validate_raw_tables(session)