snowflakedb / snowflake-cli

Snowflake CLI is an open-source command-line tool explicitly designed for developer-centric workloads in addition to SQL operations.
https://docs.snowflake.com/developer-guide/snowflake-cli-v2/index
Apache License 2.0
172 stars 54 forks source link

SNOW-1636439: "No files matched pattern" error when directory contains names in upper case. #1468

Closed sfc-gh-jvasquezrojas closed 1 week ago

sfc-gh-jvasquezrojas commented 3 weeks ago

SnowCLI version

2.6.1

Python version

Python 3.11.5

Platform

macOS-14.5-arm64-arm-64bit

What happened

No files matched pattern, even though the file exists

This lower function caused the error: image

Console output

(snowflake-cli-labs) (base) jvasquezrojas@V9P2792XJ5 snowflake-cli % snow git list-files "@jvasquez_repository/branches/dev/CICD/DB1/example.sql" -c integration                                            
+------------------------------------------------------------------------------------------------------------------------------------------------+
| name                                                  | size | md5  | sha1                                     | last_modified                 |
|-------------------------------------------------------+------+------+------------------------------------------+-------------------------------|
| jvasquez_repository/branches/dev/CICD/DB1/example.sql | 24   | None | 5114d9d042eaf0f2102539304a8d1903fc73648f | Thu, 22 Aug 2024 04:18:41 GMT |
+------------------------------------------------------------------------------------------------------------------------------------------------+

(snowflake-cli-labs) (base) jvasquezrojas@V9P2792XJ5 snowflake-cli % snow git execute "@jvasquez_repository/branches/dev/CICD/DB1/example.sql" -c integration
╭─ Error ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ No files matched pattern '@jvasquez_repository/branches/dev/CICD/DB1/example.sql'                                                                │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

How to reproduce

Create a repository in Snowflake with GitHub, add a file in upper case with sql file to the repo. Then run snow execute @<repo_name>/branches/main/<FILE_IN_UPPERCASE>/file.sql it should fail because the path contains a file in upper case.

sfc-gh-jvasquezrojas commented 3 weeks ago

Related issue https://github.com/Snowflake-Labs/snowflake-cli-action/issues/20