원클릭으로
원클릭으로
| name | local-testing-bug-fix |
| description | Fix a GitHub Local Testing issue |
Fix GitHub issue $ARGUMENTS (provide a GitHub issue URL or number) following our coding standards.
Before using this skill, ensure the following are set up:
gh CLI — must be installed and authenticated (gh auth status) to fetch issue details
tests/parameters.py — must exist (gitignored, create it manually) with your Snowflake credentials:
CONNECTION_PARAMETERS = {
"account": "your_account",
"user": "your_user",
"password": "your_password",
"database": "your_db",
"schema": "public",
}
Required only for running live integ tests. Mock-only tests (tests/mock/) do not need credentials.
Fetch and read the issue description (use gh issue view <number> or the URL)
Understand the requirements and reproduce the problem mentally
Determine if the fix is feasible (see Known Limitations below)
Find the relevant code in src/snowflake/snowpark/_internal/mock/
Implement the fix
Write or update tests (see Test approach below)
Update CHANGELOG.md (see Changelog below)
Create a commit with message format: SNOW-XXXXXXX: <description>
src/snowflake/snowpark/_internal/mock/tests/mock/tests/integ/
When a test in tests/integ/ cannot run in local testing mode, mark it:
@pytest.mark.skipif(
"config.getoption('local_testing_mode', default=False)",
reason="<explain why it is not supported>",
)
def test_something(session):
...
Validate by comparing live session output to local testing session output:
from snowflake.snowpark import Session
# live session — tries ~/.snowflake/connections.toml first, falls back to tests/parameters.py
try:
session = Session.builder.getOrCreate()
except Exception:
from tests.parameters import CONNECTION_PARAMETERS
session = Session.builder.configs(CONNECTION_PARAMETERS).create()
# local testing session
local_session = Session.builder.config("local_testing", True).create()
df = session... # DF operation
local_df = local_session... # same DF operation
df.print_schema()
df.show()
local_df.print_schema()
local_df.show()
# compare the output, fix
Run integ tests in local testing mode:
pytest tests/integ/<test_file>.py --local_testing_mode
Run mock-only tests:
pytest tests/mock/<test_file>.py
Add an entry under the top-most unreleased version in CHANGELOG.md, in the ### Snowpark Local Testing Updates > #### Bug Fixes section:
## x.y.z (TBD)
### Snowpark Local Testing Updates
#### Bug Fixes
- Fixed a bug where <description of the fix>.
If the ### Snowpark Local Testing Updates section doesn't exist yet in the TBD block, add it after ### Snowpark Python API Updates.