Skip to content

Commit 95b534d

Browse files
authored
build(NoTicket): Remove python 3.8 support and fix tests (#450)
1 parent 9e71007 commit 95b534d

File tree

15 files changed

+83
-33
lines changed

15 files changed

+83
-33
lines changed

.github/workflows/code-check.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ jobs:
1919
with:
2020
ref: ${{ inputs.branch }}
2121

22-
- name: Set up Python 3.8
22+
- name: Set up Python 3.9
2323
uses: actions/setup-python@v5
2424
with:
25-
python-version: 3.8
26-
25+
python-version: 3.9
26+
2727
- name: Install dependencies
2828
run: |
2929
python -m pip install --upgrade pip

.github/workflows/integration-tests-v1.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ jobs:
1818
- name: Check out code
1919
uses: actions/checkout@v2
2020

21-
- name: Set up Python 3.8
21+
- name: Set up Python 3.9
2222
uses: actions/setup-python@v2
2323
with:
24-
python-version: 3.8
24+
python-version: 3.9
2525

2626
- name: Install dependencies
2727
run: |
@@ -58,6 +58,7 @@ jobs:
5858
STOPPED_ENGINE_URL: ${{ steps.setup.outputs.stopped_engine_url }}
5959
API_ENDPOINT: "api.staging.firebolt.io"
6060
ACCOUNT_NAME: "firebolt"
61+
LONG_TEST_VALUE: ${{ vars.LONG_TEST_VALUE_V1 }}
6162
run: |
6263
pytest --last-failed -n 6 --dist loadgroup --timeout_method "signal" -o log_cli=true -o log_cli_level=INFO tests/integration -k "not V2 and not core" --runslow
6364

.github/workflows/integration-tests-v2.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ jobs:
2727
with:
2828
repository: 'firebolt-db/firebolt-python-sdk'
2929

30-
- name: Set up Python 3.8
30+
- name: Set up Python 3.9
3131
uses: actions/setup-python@v5
3232
with:
33-
python-version: 3.8
33+
python-version: 3.9
3434

3535
- name: Install dependencies
3636
run: |
@@ -56,6 +56,7 @@ jobs:
5656
STOPPED_ENGINE_NAME: ${{ steps.setup.outputs.stopped_engine_name }}
5757
API_ENDPOINT: "api.staging.firebolt.io"
5858
ACCOUNT_NAME: ${{ vars.FIREBOLT_ACCOUNT }}
59+
LONG_TEST_VALUE: ${{ vars.LONG_TEST_VALUE_V2 }}
5960
run: |
6061
pytest -n 6 --dist loadgroup --timeout_method "signal" -o log_cli=true -o log_cli_level=WARNING tests/integration -k "not V1 and not core" --runslow --alluredir=allure-results
6162

.github/workflows/nightly-v1.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
max-parallel: 2
3737
matrix:
3838
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
39-
python-version: ['3.8', '3.9', '3.10']
39+
python-version: ['3.9', '3.10', '3.11']
4040
steps:
4141
- name: Check out code
4242
uses: actions/checkout@v2
@@ -78,6 +78,7 @@ jobs:
7878
STOPPED_ENGINE_URL: ${{ steps.setup.outputs.stopped_engine_url }}
7979
ACCOUNT_NAME: "firebolt"
8080
API_ENDPOINT: "api.staging.firebolt.io"
81+
LONG_TEST_VALUE: ${{ vars.LONG_TEST_VALUE_V1 }}
8182
run: |
8283
pytest --timeout_method "thread" -o log_cli=true -o log_cli_level=WARNING --junit-xml=report/junit.xml tests/integration -k "not V2 and not core"
8384

.github/workflows/nightly-v2.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
max-parallel: 2
3737
matrix:
3838
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
39-
python-version: ['3.8', '3.9', '3.10']
39+
python-version: ['3.9', '3.10', '3.11']
4040
steps:
4141
- name: Check out code
4242
uses: actions/checkout@v2
@@ -74,6 +74,7 @@ jobs:
7474
STOPPED_ENGINE_NAME: ${{ steps.setup.outputs.stopped_engine_name }}
7575
ACCOUNT_NAME: ${{ vars.FIREBOLT_ACCOUNT }}
7676
API_ENDPOINT: "api.staging.firebolt.io"
77+
LONG_TEST_VALUE: ${{ vars.LONG_TEST_VALUE_V2 }}
7778
run: |
7879
pytest --timeout_method "thread" -o log_cli=true -o log_cli_level=WARNING --junit-xml=report/junit.xml tests/integration -k "not V1 and not core"
7980

.github/workflows/unit-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ jobs:
2727
with:
2828
ref: ${{ inputs.branch }}
2929

30-
- name: Set up Python 3.8
30+
- name: Set up Python 3.9
3131
uses: actions/setup-python@v2
3232
with:
33-
python-version: 3.8
33+
python-version: 3.9
3434

3535
- name: Install dependencies
3636
run: |

docsrc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ executing queries using a library of Python classes and functions.
1414
Prerequisites
1515
========================
1616

17-
* Python version 3.8 or later along with the pip package installer. For more information,
17+
* Python version 3.9 or later along with the pip package installer. For more information,
1818
see the `Python <https://www.python.org/downloads/>`_ web page.
1919

2020
* A Firebolt account and login credentials.

setup.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ classifiers =
1414
Operating System :: OS Independent
1515
Programming Language :: Python :: 3
1616
Programming Language :: Python :: 3 :: Only
17-
Programming Language :: Python :: 3.8
1817
Programming Language :: Python :: 3.9
1918
Programming Language :: Python :: 3.10
2019
Programming Language :: Python :: 3.11
@@ -40,7 +39,7 @@ install_requires =
4039
sqlparse>=0.4.2
4140
trio>=0.22.0
4241
truststore>=0.10;python_version>="3.10"
43-
python_requires = >=3.8
42+
python_requires = >=3.9
4443
include_package_data = True
4544
package_dir =
4645
= src

tests/integration/dbapi/async/V1/test_queries_async.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
from firebolt.async_db import Binary, Connection, Cursor, OperationalError
1010
from firebolt.common._types import ColType
1111
from firebolt.common.row_set.types import Column
12+
from tests.integration.dbapi.conftest import LONG_SELECT_DEFAULT_V1
1213

1314
VALS_TO_INSERT_2 = ",".join(
1415
[f"({i}, {i-3}, '{val}')" for (i, val) in enumerate(range(4, 1000))]
1516
)
1617
LONG_INSERT = f'INSERT INTO "test_tbl" VALUES {VALS_TO_INSERT_2}'
1718
LONG_SELECT = (
18-
"SELECT checksum(*) FROM GENERATE_SERIES(1, 250000000000)" # approx 6m runtime
19+
"SELECT checksum(*) FROM GENERATE_SERIES(1, {long_value})" # approx 6m runtime
1920
)
2021

2122
CREATE_EXTERNAL_TABLE = """CREATE EXTERNAL TABLE IF NOT EXISTS "ex_lineitem" (
@@ -174,14 +175,17 @@ async def test_select_nan(connection: Connection) -> None:
174175
async def test_long_query(
175176
connection: Connection,
176177
minimal_time: Callable[[float], None],
178+
long_test_value: int,
177179
) -> None:
178180
"""AWS ALB TCP timeout set to 350; make sure we handle the keepalive correctly."""
179181

180182
# Fail test if it takes less than 350 seconds
181183
minimal_time(350)
182184

183185
async with connection.cursor() as c:
184-
await c.execute(LONG_SELECT)
186+
await c.execute(
187+
LONG_SELECT.format(long_value=long_test_value(LONG_SELECT_DEFAULT_V1))
188+
)
185189
data = await c.fetchall()
186190
assert len(data) == 1, "Invalid data size returned by fetchall"
187191

tests/integration/dbapi/async/V2/test_queries_async.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@
1212
from firebolt.common._types import ColType
1313
from firebolt.common.row_set.types import Column
1414
from firebolt.utils.exception import FireboltStructuredError
15+
from tests.integration.dbapi.conftest import LONG_SELECT_DEFAULT_V2
1516
from tests.integration.dbapi.utils import assert_deep_eq
1617

1718
VALS_TO_INSERT_2 = ",".join(
1819
[f"({i}, {i-3}, '{val}')" for (i, val) in enumerate(range(4, 1000))]
1920
)
2021
LONG_INSERT = f'INSERT INTO "test_tbl" VALUES {VALS_TO_INSERT_2}'
2122
LONG_SELECT = (
22-
"SELECT checksum(*) FROM GENERATE_SERIES(1, 400000000000)" # approx 6m runtime
23+
"SELECT checksum(*) FROM GENERATE_SERIES(1, {long_value})" # approx 6m runtime
2324
)
2425

2526

@@ -102,13 +103,16 @@ async def test_select_nan(connection: Connection) -> None:
102103
async def test_long_query(
103104
connection: Connection,
104105
minimal_time: Callable[[float], None],
106+
long_test_value: Callable[[int], int],
105107
) -> None:
106108
"""AWS ALB TCP timeout set to 350; make sure we handle the keepalive correctly."""
107109

108110
minimal_time(350)
109111

110112
async with connection.cursor() as c:
111-
await c.execute(LONG_SELECT)
113+
await c.execute(
114+
LONG_SELECT.format(long_value=long_test_value(LONG_SELECT_DEFAULT_V2))
115+
)
112116
data = await c.fetchall()
113117
assert len(data) == 1, "Invalid data size returned by fetchall"
114118

@@ -265,16 +269,16 @@ async def test_empty_query(c: Cursor, query: str, params: tuple) -> None:
265269
async def test_parameterized_query_with_special_chars(connection: Connection) -> None:
266270
"""Query parameters are handled properly."""
267271
async with connection.cursor() as c:
268-
params = ["text with 'quote'", "text with \\slashes"]
272+
parameters = ["text with 'quote'", "text with \\slashes"]
269273

270274
await c.execute(
271275
"SELECT ? as one, ? as two",
272-
params,
276+
parameters,
273277
)
274278

275279
result = await c.fetchall()
276280
assert result == [
277-
[params[0], params[1]]
281+
[parameters[0], parameters[1]]
278282
], "Invalid data in table after parameterized insert"
279283

280284

0 commit comments

Comments
 (0)