Skip to content

Commit 0d4f089

Browse files
authored
NO-SNOW: fix daily test failure due to missing odbc driver (#3814)
1 parent 3c40b21 commit 0d4f089

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

.github/workflows/daily_precommit.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,14 @@ jobs:
197197
SNOWPARK_PYTHON_API_TEST_BUCKET_PATH: ${{ secrets.SNOWPARK_PYTHON_API_TEST_BUCKET_PATH }}
198198
SNOWPARK_PYTHON_API_S3_STORAGE_INTEGRATION: ${{ vars.SNOWPARK_PYTHON_API_S3_STORAGE_INTEGRATION }}
199199
shell: bash
200+
- name: Install MS ODBC Driver (Ubuntu only)
201+
if: ${{ matrix.os.download_name == 'linux' }}
202+
run: |
203+
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
204+
curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list
205+
sudo apt-get update
206+
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18 unixodbc-dev
207+
shell: bash
200208
- name: Run data source tests
201209
# psycopg2 is not supported on macos 3.9
202210
if: ${{ !(contains('macos', matrix.os.download_name) && matrix.python-version == '3.9') }}

tests/integ/datasource/test_sql_server.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from snowflake.snowpark.types import StringType
99

1010
from tests.parameters import SQL_SERVER_CONNECTION_PARAMETERS
11-
from tests.utils import IS_IN_STORED_PROC, Utils
11+
from tests.utils import IS_IN_STORED_PROC, Utils, IS_WINDOWS, IS_MACOS, RUNNING_ON_GH
1212
from tests.resources.test_data_source_dir.test_sql_server_data import (
1313
SQL_SERVER_TABLE_NAME,
1414
EXPECTED_TEST_DATA,
@@ -36,6 +36,10 @@
3636
pytestmark = [
3737
pytest.mark.skipif(DEPENDENCIES_PACKAGE_UNAVAILABLE, reason="Missing 'pyodbc'"),
3838
pytest.mark.skipif(IS_IN_STORED_PROC, reason="Need External Access Integration"),
39+
pytest.mark.skipif(
40+
RUNNING_ON_GH and (IS_WINDOWS or IS_MACOS),
41+
reason="ODBC Driver 18 for SQL Server is not installed",
42+
),
3943
]
4044

4145

0 commit comments

Comments
 (0)