Skip to content

Commit

Permalink
fix github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
buremba committed Jan 8, 2025
1 parent f7cedc0 commit 32c6f0d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,5 @@ jobs:
env:
SNOWFLAKE_CONNECTIONS_BASE64: ${{ secrets.SNOWFLAKE_CONNECTIONS_BASE64 }}
run: |
rm /home/runner/.config/snowflake/connections.toml
export SNOWFLAKE_CONNECTIONS=$(echo $SNOWFLAKE_CONNECTIONS_BASE64 | base64 --decode)
export SNOWFLAKE_CONNECTIONS=$(printf '%s' "$SNOWFLAKE_CONNECTIONS_BASE64" | base64 -d | tr '\r' '\n')
poetry run pytest tests/integration/*
12 changes: 6 additions & 6 deletions universql/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,11 +397,11 @@ def calculate_script_cost(duration_second, electricity_rate=0.15, pc_lifetime_ye
pattern = r'(\w+)(?:\(([^)]*)\))'


def parse_compute(value):
if value is not None:
matches = re.findall(pattern, value)
def parse_compute(warehouse):
if warehouse is not None:
matches = re.findall(pattern, warehouse)
if len(matches) == 0:
matches = (('local', ''), ('snowflake', f'warehouse={value}'))
matches = (('local', ''), ('snowflake', f'warehouse={warehouse}'))
else:
# try locally if warehouse is not provided
matches = (('local', ''), )
Expand All @@ -412,8 +412,8 @@ def parse_compute(value):
if args_str:
for arg in args_str.split(','):
if '=' in arg:
key, value = arg.split('=', 1)
args[key.strip()] = value.strip()
key, warehouse = arg.split('=', 1)
args[key.strip()] = warehouse.strip()
else:
args[arg.strip()] = None # Handle arguments without '='
result.append({'name': func_name, 'args': args})
Expand Down

0 comments on commit 32c6f0d

Please sign in to comment.