Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Commit 395fcfa

Browse files
committed
Bump sqlalchemy version
Previously, `worker` would pin this to v1.3, but that would then fail tests within `shared` in a common workspace, as some tests in `shared` depend on v1.4 features.
1 parent 880008c commit 395fcfa

File tree

7 files changed

+49
-21
lines changed

7 files changed

+49
-21
lines changed

database/base.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
from sqlalchemy import Column, types
44
from sqlalchemy.dialects.postgresql import UUID
5-
from sqlalchemy.ext.declarative import declarative_base
6-
from sqlalchemy.orm import Session
5+
from sqlalchemy.orm import Session, declarative_base
76

87
from helpers.clock import get_utc_now
98

database/engine.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def create_session(self):
5454
timeseries_engine = self.timeseries_engine
5555

5656
class RoutingSession(Session):
57-
def get_bind(self, mapper=None, clause=None):
57+
def get_bind(self, mapper=None, clause=None, **kwargs):
5858
if mapper is not None and issubclass(
5959
mapper.class_, TimeseriesBaseModel
6060
):
@@ -78,12 +78,12 @@ def get_bind(self, mapper=None, clause=None):
7878
database_url=get_config(
7979
"services",
8080
"database_url",
81-
default="postgres://postgres:@postgres:5432/postgres",
81+
default="postgresql://postgres:@postgres:5432/postgres",
8282
),
8383
timeseries_database_url=get_config(
8484
"services",
8585
"timeseries_database_url",
86-
default="postgres://postgres:@timescale:5432/postgres",
86+
default="postgresql://postgres:@timescale:5432/postgres",
8787
),
8888
)
8989

docker/test_codecov_config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ setup:
77
enabled: true
88

99
services:
10-
database_url: postgres://postgres:password@postgres:5432/postgres
11-
timeseries_database_url: postgres://postgres:password@timescale:5432/postgres
10+
database_url: postgresql://postgres:password@postgres:5432/postgres
11+
timeseries_database_url: postgresql://postgres:password@timescale:5432/postgres
1212
redis_url: redis://redis:6379
1313
minio:
1414
hash_key: testixik8qdauiab1yiffydimvi72ekq # never change this

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ dependencies = [
3939
"requests>=2.32.0",
4040
"sentry-sdk>=2.13.0",
4141
"shared",
42-
"sqlalchemy==1.3.*",
43-
"sqlparse==0.5.0",
42+
"sqlalchemy<2",
43+
"sqlparse>=0.5.0",
4444
"statsd>=3.3.0",
4545
"stripe>=11.4.1",
4646
"test-results-parser",

ta_storage/pg.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,15 @@ def get_repo_flag_ids(db_session: Session, repoid: int, flags: list[str]) -> set
3737
if not flags:
3838
return set()
3939

40-
return set(
41-
db_session.query(RepositoryFlag.id_)
40+
return {
41+
flag.id_
42+
for flag in db_session.query(RepositoryFlag.id_)
4243
.filter(
4344
RepositoryFlag.repository_id == repoid,
4445
RepositoryFlag.flag_name.in_(flags),
4546
)
4647
.all()
47-
)
48+
}
4849

4950

5051
def modify_structures(

tasks/test_results_processor.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,15 @@ def get_repo_flag_ids(db_session: Session, repoid: int, flags: list[str]) -> set
4444
if not flags:
4545
return set()
4646

47-
return set(
48-
db_session.query(RepositoryFlag.id_)
47+
return {
48+
flag.id_
49+
for flag in db_session.query(RepositoryFlag.id_)
4950
.filter(
5051
RepositoryFlag.repository_id == repoid,
5152
RepositoryFlag.flag_name.in_(flags),
5253
)
5354
.all()
54-
)
55+
}
5556

5657

5758
def create_daily_totals(

uv.lock

Lines changed: 33 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)